Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
importlib.test.source.test_abc_loader.SourceLoaderTestHarness Class Reference
Inheritance diagram for importlib.test.source.test_abc_loader.SourceLoaderTestHarness:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def setUp
def verify_module
def verify_code

Public Attributes

 package
 path
 name
 cached
 loader

Detailed Description

Definition at line 538 of file test_abc_loader.py.


Member Function Documentation

def importlib.test.source.test_abc_loader.SourceLoaderTestHarness.setUp (   self,
  is_package = True,
  kwargs 
)

Definition at line 540 of file test_abc_loader.py.

00540 
00541     def setUp(self, *, is_package=True, **kwargs):
00542         self.package = 'pkg'
00543         if is_package:
00544             self.path = os.path.join(self.package, '__init__.py')
00545             self.name = self.package
00546         else:
00547             module_name = 'mod'
00548             self.path = os.path.join(self.package, '.'.join(['mod', 'py']))
00549             self.name = '.'.join([self.package, module_name])
00550         self.cached = imp.cache_from_source(self.path)
00551         self.loader = self.loader_mock(self.path, **kwargs)

Here is the caller graph for this function:

Definition at line 565 of file test_abc_loader.py.

00565 
00566     def verify_code(self, code_object):
00567         module = imp.new_module(self.name)
00568         module.__file__ = self.path
00569         module.__cached__ = self.cached
00570         module.__package__ = self.package
00571         module.__loader__ = self.loader
00572         module.__path__ = []
00573         exec(code_object, module.__dict__)
00574         self.verify_module(module)
00575 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 552 of file test_abc_loader.py.

00552 
00553     def verify_module(self, module):
00554         self.assertEqual(module.__name__, self.name)
00555         self.assertEqual(module.__file__, self.path)
00556         self.assertEqual(module.__cached__, self.cached)
00557         self.assertEqual(module.__package__, self.package)
00558         self.assertEqual(module.__loader__, self.loader)
00559         values = module._.split('::')
00560         self.assertEqual(values[0], self.name)
00561         self.assertEqual(values[1], self.path)
00562         self.assertEqual(values[2], self.cached)
00563         self.assertEqual(values[3], self.package)
00564         self.assertEqual(values[4], repr(self.loader))

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 549 of file test_abc_loader.py.

Definition at line 550 of file test_abc_loader.py.

Definition at line 544 of file test_abc_loader.py.

Definition at line 541 of file test_abc_loader.py.

Definition at line 543 of file test_abc_loader.py.


The documentation for this class was generated from the following file: