#NEWLINE# def test_no_path( self ) : #NEWLINE# #INDENT# mod_name = 'top_level' #NEWLINE# assert ( '.' not in mod_name ) #NEWLINE# with util . mock_modules ( mod_name ) as importer : #NEWLINE# #INDENT# ( log , wrapped_call ) = self . log ( importer . find_module ) #NEWLINE# importer . find_module = MethodType ( wrapped_call , importer ) #NEWLINE# with util . import_state ( meta_path = [ importer ] ) : #NEWLINE# #INDENT# import_util . import_ ( mod_name ) #NEWLINE# assert ( len ( log ) == 1 ) #NEWLINE# args = log [ 0 ] [ 0 ] #NEWLINE# kwargs = log [ 0 ] [ 1 ] #NEWLINE# self . assertEqual ( len ( args ) , 2 ) #NEWLINE# self . assertEqual ( len ( kwargs ) , 0 ) #NEWLINE# self . assertEqual ( args [ 0 ] , mod_name ) #NEWLINE# self . assertIsNone ( args [ 1 ] )