Exemple #1
0
 def test_get_class_by_path_invalid_class_name(self):
     try:
         prod_web_config = utils.get_class_by_path("sigurd.tests.configs.project_complex.BlablaProdWebConfig")
         self.fail("AttributeError was not called for wrong class name")
     except AttributeError:
         # OK
         pass
Exemple #2
0
 def test_get_class_by_path_invalid_path(self):
     try:
         prod_web_config = utils.get_class_by_path("sigurd.blabla.project_complex.ProdWebConfig")
         self.fail("ImportError was not called for wrong package pass")
     except ImportError:
         # OK
         pass
Exemple #3
0
 def test_get_class_by_path_invalid_class_name(self):
     try:
         prod_web_config = utils.get_class_by_path(
             "sigurd.tests.configs.project_complex.BlablaProdWebConfig")
         self.fail("AttributeError was not called for wrong class name")
     except AttributeError:
         # OK
         pass
Exemple #4
0
 def test_get_class_by_path_invalid_path(self):
     try:
         prod_web_config = utils.get_class_by_path(
             "sigurd.blabla.project_complex.ProdWebConfig")
         self.fail("ImportError was not called for wrong package pass")
     except ImportError:
         # OK
         pass
Exemple #5
0
 def install_app(self, app_config):
     """
     Installs application config.
     app_config can be class or string with python path to class.
     """
     if isinstance(app_config, basestring):
         try:
             app_config = utils.get_class_by_path(app_config)
         except (ImportError, AttributeError), e:
             raise ConfigurationError(
                 "Project config[%s]: Cannot install application config [%s] because of error: %s "
                 % (self.__class__.__name__, str(app_config), str(e)))
Exemple #6
0
 def install_app(self, app_config):
     """
     Installs application config.
     app_config can be class or string with python path to class.
     """
     if isinstance(app_config, basestring):
         try:
             app_config = utils.get_class_by_path(app_config)
         except (ImportError, AttributeError), e:
             raise ConfigurationError(
                 "Project config[%s]: Cannot install application config [%s] because of error: %s " % (
                     self.__class__.__name__, str(app_config), str(e)))
Exemple #7
0
 def test_get_class_by_path(self):
     prod_web_config = utils.get_class_by_path(
         "sigurd.tests.configs.project_complex.ProdWebConfig")
     self.assertEquals(ProdWebConfig, prod_web_config)
Exemple #8
0
 def test_get_class_by_path(self):
     prod_web_config = utils.get_class_by_path("sigurd.tests.configs.project_complex.ProdWebConfig")
     self.assertEquals(ProdWebConfig, prod_web_config)