Back to index

python3.2  3.2.2
Public Member Functions
importlib.test.source.test_abc_loader.PyLoaderInterfaceTests Class Reference

List of all members.

Public Member Functions

def test_no_source_path
def test_source_path_is_None
def test_get_filename_with_source_path
def test_get_filename_no_source_path

Detailed Description

Tests for importlib.abc.PyLoader to make sure that when source_path()
doesn't return a path everything works as expected.

Definition at line 297 of file test_abc_loader.py.


Member Function Documentation

Definition at line 323 of file test_abc_loader.py.

00323 
00324     def test_get_filename_no_source_path(self):
00325         # get_filename() should raise ImportError if source_path returns None.
00326         name = 'mod'
00327         mock = PyLoaderMock({name: None})
00328         with util.uncache(name), self.assertRaises(ImportError):
00329             mock.get_filename(name)
00330 

Here is the call graph for this function:

Definition at line 315 of file test_abc_loader.py.

00315 
00316     def test_get_filename_with_source_path(self):
00317         # get_filename() should return what source_path() returns.
00318         name = 'mod'
00319         path = os.path.join('path', 'to', 'source')
00320         mock = PyLoaderMock({name: path})
00321         with util.uncache(name):
00322             self.assertEqual(mock.get_filename(name), path)

Here is the call graph for this function:

Definition at line 302 of file test_abc_loader.py.

00302 
00303     def test_no_source_path(self):
00304         # No source path should lead to ImportError.
00305         name = 'mod'
00306         mock = PyLoaderMock({})
00307         with util.uncache(name), self.assertRaises(ImportError):
00308             mock.load_module(name)

Here is the call graph for this function:

Definition at line 309 of file test_abc_loader.py.

00309 
00310     def test_source_path_is_None(self):
00311         name = 'mod'
00312         mock = PyLoaderMock({name: None})
00313         with util.uncache(name), self.assertRaises(ImportError):
00314             mock.load_module(name)

Here is the call graph for this function:


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