<s> import pytest <EOL> from pyqode . core . widgets import RecentFilesManager , MenuRecentFiles <EOL> import pyqode . core <EOL> def test_open_file ( ) : <EOL> manager = RecentFilesManager ( '<STR_LIT>' , '<STR_LIT:test>' ) <EOL> manager . clear ( ) <EOL> assert manager . last_file ( ) is None <EOL> manager . open_file ( __file__ ) <EOL> assert len ( manager . get_recent_files ( ) ) == <NUM_LIT:1> <EOL> assert manager . last_file ( ) == __file__ <EOL> def test_remove_file ( ) : <EOL> manager = RecentFilesManager ( '<STR_LIT>' , '<STR_LIT:test>' ) <EOL> manager . max_recent_files = <NUM_LIT:10> <EOL> manager . clear ( ) <EOL> manager . open_file ( __file__ ) <EOL> test_path = pyqode . core . __file__ <EOL> manager . open_file ( test_path ) <EOL> assert len ( manager . get_recent_files ( ) ) == <NUM_LIT:2> <EOL> assert manager . last_file ( ) == test_path <EOL> manager . remove ( test_path ) <EOL> assert len ( manager . get_recent_files ( ) ) == <NUM_LIT:1> <EOL> assert manager . last_file ( ) == __file__ <EOL> def test_max_files ( ) : <EOL> manager = RecentFilesManager ( '<STR_LIT>' , '<STR_LIT:test>' ) <EOL> manager . clear ( ) <EOL> manager . max_recent_files = <NUM_LIT:1> <EOL> manager . open_file ( __file__ ) <EOL> assert manager . last_file ( ) == __file__ <EOL> manager . open_file ( pyqode . core . __file__ ) <EOL> assert manager . last_file ( ) == pyqode . core . __file__ <EOL> assert len ( manager . get_recent_files ( ) ) == <NUM_LIT:1> <EOL> def test_menu_recent_files ( ) : <EOL> manager = RecentFilesManager ( '<STR_LIT>' , '<STR_LIT:test>' ) <EOL> manager . clear ( ) <EOL> manager . open_file ( __file__ ) <EOL> manager . open_file ( pyqode . core . __file__ ) <EOL> mnu = MenuRecentFiles ( None , recent_files_manager = manager , title = '<STR_LIT>' , <EOL> icon_provider = None , clear_icon = None ) <EOL> mnu . show ( ) <EOL> def test_normalized_path ( ) : <EOL> manager = RecentFilesManager ( '<STR_LIT>' , '<STR_LIT:test>' ) <EOL> manager . clear ( ) <EOL> manager . open_file ( r'<STR_LIT>' ) <EOL> manager . open_file ( r'<STR_LIT>' ) <EOL> assert len ( manager . get_value ( '<STR_LIT:list>' , [ ] ) ) == <NUM_LIT:1> </s>
