Back to index

python3.2  3.2.2
Classes | Public Member Functions
test.test_pkgutil.PkgutilPEP302Tests Class Reference

List of all members.

Classes

class  MyTestImporter
class  MyTestLoader

Public Member Functions

def setUp
def tearDown
def test_getdata_pep302
def test_alreadyloaded

Detailed Description

Definition at line 87 of file test_pkgutil.py.


Member Function Documentation

Definition at line 108 of file test_pkgutil.py.

00108 
00109     def setUp(self):
00110         sys.meta_path.insert(0, self.MyTestImporter())

Here is the caller graph for this function:

Definition at line 111 of file test_pkgutil.py.

00111 
00112     def tearDown(self):
00113         del sys.meta_path[0]

Here is the caller graph for this function:

Definition at line 119 of file test_pkgutil.py.

00119 
00120     def test_alreadyloaded(self):
00121         # Ensure that get_data works without reloading - the "loads" module
00122         # variable in the example loader should count how many times a reload
00123         # occurs.
00124         import foo
00125         self.assertEqual(foo.loads, 1)
00126         self.assertEqual(pkgutil.get_data('foo', 'dummy'), "Hello, world!")
00127         self.assertEqual(foo.loads, 1)
00128         del sys.modules['foo']

Here is the call graph for this function:

Definition at line 114 of file test_pkgutil.py.

00114 
00115     def test_getdata_pep302(self):
00116         # Use a dummy importer/loader
00117         self.assertEqual(pkgutil.get_data('foo', 'dummy'), "Hello, world!")
00118         del sys.modules['foo']

Here is the call graph for this function:


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