Exemplo n.º 1
0
 def test_import_class_happy_path(self):
     i = _ImportablePathWrapper("collections.OrderedDict")
     c = i.import_class()
     self.assertEqual(type(c()).__name__, 'OrderedDict')
Exemplo n.º 2
0
 def test_raises_ModuleNotImportableError_on_non_existant_module(self):
     i = _ImportablePathWrapper("aaaa.aaaa.aaaa")
     self.assertRaises(ModuleNotImportableError, i.import_module)
Exemplo n.º 3
0
 def test_import_module_happy_path(self):
     i = _ImportablePathWrapper("collections.OrderedDict")
     m = i.import_module()
     self.assertEqual(type(m.OrderedDict()).__name__, 'OrderedDict')
Exemplo n.º 4
0
 def test_raises_ClassNotImportableError_on_non_existant_class(self):
     i = _ImportablePathWrapper("collections.aaaaDoesNotExistaaa")
     self.assertRaises(ClassNotImportableError, i.import_class)
Exemplo n.º 5
0
 def test_import_class_happy_path(self):
     i = _ImportablePathWrapper("collections.OrderedDict")
     c = i.import_class()
     self.assertEqual(type(c()).__name__, 'OrderedDict')
Exemplo n.º 6
0
 def test_import_module_happy_path(self):
     i = _ImportablePathWrapper("collections.OrderedDict")
     m = i.import_module()
     self.assertEqual(type(m.OrderedDict()).__name__, 'OrderedDict')
Exemplo n.º 7
0
 def test_raises_ModuleNotImportableError_on_non_existant_module(self):
     i = _ImportablePathWrapper("aaaa.aaaa.aaaa")
     self.assertRaises(ModuleNotImportableError, i.import_module)
Exemplo n.º 8
0
 def test_raises_ClassNotImportableError_on_non_existant_class(self):
     i = _ImportablePathWrapper("collections.aaaaDoesNotExistaaa")
     self.assertRaises(ClassNotImportableError, i.import_class)