Exemplo n.º 1
0
class ABCTests(unittest.TestCase):
    def setUp(self):
        self.loader = NamespaceLoader('foo', ['pkg'],
                                      importlib.machinery.PathFinder)

    def test_is_package(self):
        self.assertTrue(self.loader.is_package('foo'))

    def test_get_code(self):
        self.assertTrue(isinstance(self.loader.get_code('foo'),
                                   types.CodeType))

    def test_get_source(self):
        self.assertEqual(self.loader.get_source('foo'), '')

    def test_abc_isinstance(self):
        self.assertTrue(isinstance(self.loader, importlib.abc.InspectLoader))
class ABCTests(unittest.TestCase):

    def setUp(self):
        self.loader = NamespaceLoader('foo', ['pkg'],
                                      importlib.machinery.PathFinder)

    def test_is_package(self):
        self.assertTrue(self.loader.is_package('foo'))

    def test_get_code(self):
        self.assertTrue(isinstance(self.loader.get_code('foo'), types.CodeType))

    def test_get_source(self):
        self.assertEqual(self.loader.get_source('foo'), '')

    def test_abc_isinstance(self):
        self.assertTrue(isinstance(self.loader, importlib.abc.InspectLoader))
Exemplo n.º 3
0
 def setUp(self):
     self.loader = NamespaceLoader('foo', ['pkg'],
                                   importlib.machinery.PathFinder)
 def setUp(self):
     self.loader = NamespaceLoader('foo', ['pkg'],
                                   importlib.machinery.PathFinder)