コード例 #1
0
ファイル: test_utils.py プロジェクト: airtonix/sigurd
 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
コード例 #2
0
ファイル: test_utils.py プロジェクト: airtonix/sigurd
 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
コード例 #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
コード例 #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
コード例 #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)))
コード例 #6
0
ファイル: project_config.py プロジェクト: airtonix/sigurd
 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)))
コード例 #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)
コード例 #8
0
ファイル: test_utils.py プロジェクト: airtonix/sigurd
 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)