Ejemplo n.º 1
0
 def test_no_dotted_path(self):
     with pytest.raises(AttributeError):
         load_class("NoModule")
Ejemplo n.º 2
0
 def test_class_does_not_exist(self):
     with pytest.raises(AttributeError):
         load_class("service.handlers.base.NoClass")
Ejemplo n.º 3
0
 def test_nomodule_noclass(self):
     with pytest.raises(ImportError):
         load_class("service.handlers.no_such_module.NoModule")
Ejemplo n.º 4
0
 def test_loader_success(self):
     base_handler = load_class("service.handlers.base.BaseHandler")
     assert issubclass(base_handler, BaseHandler) == True
     assert base_handler.__name__ == 'BaseHandler'
Ejemplo n.º 5
0
 def test_module_does_not_exist(self):
     with pytest.raises(AttributeError):
         load_class("service.handlers.no_such_module")
Ejemplo n.º 6
0
 def test_no_dotted_path(self):
     with pytest.raises(AttributeError):
         load_class("NoModule")
Ejemplo n.º 7
0
 def test_nomodule_noclass(self):
     with pytest.raises(ImportError):
         load_class("service.handlers.no_such_module.NoModule")
Ejemplo n.º 8
0
 def test_class_does_not_exist(self):
     with pytest.raises(AttributeError):
         load_class("service.handlers.base.NoClass")
Ejemplo n.º 9
0
 def test_module_does_not_exist(self):
     with pytest.raises(AttributeError):
         load_class("service.handlers.no_such_module")
Ejemplo n.º 10
0
 def test_loader_success(self):
     base_handler = load_class("service.handlers.base.BaseHandler")
     assert issubclass(base_handler, BaseHandler) == True
     assert base_handler.__name__ == 'BaseHandler'