@ -39,8 +39,8 @@ class LoadModuleTest(ImporterMixin, testlib.TestCase):
def test_module_added_to_sys_modules ( self ) :
def test_module_added_to_sys_modules ( self ) :
self . context . send_await . return_value = self . response
self . context . send_await . return_value = self . response
mod = self . importer . load_module ( self . modname )
mod = self . importer . load_module ( self . modname )
self . assert True ( sys . modules [ self . modname ] is mod )
self . assert Is ( sys . modules [ self . modname ] , mod )
self . assert True( isi nstance( mod , types . ModuleType ) )
self . assert IsI nstance( mod , types . ModuleType )
def test_module_file_set ( self ) :
def test_module_file_set ( self ) :
self . context . send_await . return_value = self . response
self . context . send_await . return_value = self . response
@ -50,12 +50,12 @@ class LoadModuleTest(ImporterMixin, testlib.TestCase):
def test_module_loader_set ( self ) :
def test_module_loader_set ( self ) :
self . context . send_await . return_value = self . response
self . context . send_await . return_value = self . response
mod = self . importer . load_module ( self . modname )
mod = self . importer . load_module ( self . modname )
self . assert True( mod . __loader__ is self . importer )
self . assert Is( mod . __loader__ , self . importer )
def test_module_package_unset ( self ) :
def test_module_package_unset ( self ) :
self . context . send_await . return_value = self . response
self . context . send_await . return_value = self . response
mod = self . importer . load_module ( self . modname )
mod = self . importer . load_module ( self . modname )
self . assert True( mod . __package__ is None )
self . assert IsNone( mod . __package__ )
class LoadSubmoduleTest ( ImporterMixin , testlib . TestCase ) :
class LoadSubmoduleTest ( ImporterMixin , testlib . TestCase ) :
@ -96,7 +96,7 @@ class LoadModulePackageTest(ImporterMixin, testlib.TestCase):
def test_module_loader_set ( self ) :
def test_module_loader_set ( self ) :
self . context . send_await . return_value = self . response
self . context . send_await . return_value = self . response
mod = self . importer . load_module ( self . modname )
mod = self . importer . load_module ( self . modname )
self . assert True( mod . __loader__ is self . importer )
self . assert Is( mod . __loader__ , self . importer )
def test_module_path_present ( self ) :
def test_module_path_present ( self ) :
self . context . send_await . return_value = self . response
self . context . send_await . return_value = self . response
@ -111,7 +111,7 @@ class LoadModulePackageTest(ImporterMixin, testlib.TestCase):
def test_module_data ( self ) :
def test_module_data ( self ) :
self . context . send_await . return_value = self . response
self . context . send_await . return_value = self . response
mod = self . importer . load_module ( self . modname )
mod = self . importer . load_module ( self . modname )
self . assert True( isi nstance( mod . func , types . FunctionType ) )
self . assert IsI nstance( mod . func , types . FunctionType )
self . assertEquals ( mod . func . __module__ , self . modname )
self . assertEquals ( mod . func . __module__ , self . modname )