#NEWLINE# def test_pathcompleter_completes_files_in_current_directory( self ) : #NEWLINE# #INDENT# test_dir = tempfile . mkdtemp ( ) #NEWLINE# write_test_files ( test_dir ) #NEWLINE# expected = sorted ( [ str ( expected ) for i in range ( 10 ) ] ) #NEWLINE# if ( not test_dir . endswith ( os . path . sep ) ) : #NEWLINE# #INDENT# test_dir += os . path . sep #NEWLINE# #UNINDENT# with chdir ( test_dir ) : #NEWLINE# #INDENT# completer = PathCompleter ( ) #NEWLINE# doc_text = '' #NEWLINE# doc = Document ( doc_text , len ( doc_text ) ) #NEWLINE# event = CompleteEvent ( ) #NEWLINE# completions = list ( completer . get_completions ( doc , event ) ) #NEWLINE# result = sorted ( ( c . text for c in completions ) ) #NEWLINE# self . assertEqual ( expected , result ) #NEWLINE# #UNINDENT# shutil . rmtree ( test_dir )