Back to index

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

List of all members.

Public Member Functions

def get_filename_check
def test_filename_with_source_bc
def test_filename_with_source_no_bc
def test_filename_with_no_source_bc
def test_filename_with_no_source_or_bc

Detailed Description

Test for the interface of importlib.abc.PyPycLoader.

Definition at line 371 of file test_abc_loader.py.


Member Function Documentation

def importlib.test.source.test_abc_loader.PyPycLoaderInterfaceTests.get_filename_check (   self,
  src_path,
  bc_path,
  expect 
)

Definition at line 375 of file test_abc_loader.py.

00375 
00376     def get_filename_check(self, src_path, bc_path, expect):
00377         name = 'mod'
00378         mock = PyPycLoaderMock({name: src_path}, {name: {'path': bc_path}})
00379         with util.uncache(name):
00380             assert mock.source_path(name) == src_path
00381             assert mock.bytecode_path(name) == bc_path
00382             self.assertEqual(mock.get_filename(name), expect)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 391 of file test_abc_loader.py.

00391 
00392     def test_filename_with_no_source_bc(self):
00393         # With not source but bc, return the bc path.
00394         self.get_filename_check(None, 'bc_path', 'bc_path')

Here is the call graph for this function:

Definition at line 395 of file test_abc_loader.py.

00395 
00396     def test_filename_with_no_source_or_bc(self):
00397         # With no source or bc, raise ImportError.
00398         name = 'mod'
00399         mock = PyPycLoaderMock({name: None}, {name: {'path': None}})
00400         with util.uncache(name), self.assertRaises(ImportError):
00401             mock.get_filename(name)
00402 

Here is the call graph for this function:

Definition at line 383 of file test_abc_loader.py.

00383 
00384     def test_filename_with_source_bc(self):
00385         # When source and bytecode paths present, return the source path.
00386         self.get_filename_check('source_path', 'bc_path', 'source_path')

Here is the call graph for this function:

Definition at line 387 of file test_abc_loader.py.

00387 
00388     def test_filename_with_source_no_bc(self):
00389         # With source but no bc, return source path.
00390         self.get_filename_check('source_path', None, 'source_path')

Here is the call graph for this function:


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