Exemplo n.º 1
0
 def testImportError(self):
     wrong = lazy_import('inject_tests.fixtures.lazy.WrongClass', None)
     self.assertRaises(ImportError, wrong)
Exemplo n.º 2
0
 def testReferenceImportError(self):
     r = lazy_import('WrongRef', globals())
     self.assertRaises(ImportError, r) 
Exemplo n.º 3
0
 def testImport(self):
     a = lazy_import('inject_tests.fixtures.lazy.A', None)
     
     from inject_tests.fixtures.lazy import A
     self.assertTrue(a() is A)
Exemplo n.º 4
0
 def testReference(self):
     r = lazy_import('Ref', globals())
     self.assertTrue(r() is Ref)