Example #1
0
    def setUp(self):
        # call the base implementation
        super(ConfigurationEnabledTestCase, self).setUp()

        # configure the local service
        local.request = local.Process()
        local.worker = local.Process()

        # read the configuration
        conf_path = test_resource_path('conf', 'eureka.cfg.template')
        defaults = dict(here='string(default="%s")' %
                        os.path.abspath(os.path.dirname(conf_path)))
        conf = read_application_options(conf_path, self.fail, defaults)

        # initialize the application context
        # no root component since we only want to perform the configuration
        app = BaseApplication(None)
        app.PLATFORM = "Eureka base"
        app.set_config(conf_path, conf, self.fail)
        app.set_base_url('http://localhost/')  # dummy server host
        app.set_locale(i18n.Locale('en', 'US'))  # Set the default Locale

        # install the configuration
        registry.configure(app.configuration)

        # configure the security manager
        security.set_manager(app.security)
Example #2
0
    def setUp(self):
        # call the base implementation
        super(ConfigurationEnabledTestCase, self).setUp()

        # configure the local service
        local.request = local.Process()
        local.worker = local.Process()

        # read the configuration
        conf_path = test_resource_path('conf', 'eureka.cfg.template')
        defaults = dict(
            here='string(default="%s")' %
            os.path.abspath(os.path.dirname(conf_path))
        )
        conf = read_application_options(conf_path, self.fail, defaults)

        # initialize the application context
        # no root component since we only want to perform the configuration
        app = BaseApplication(None)
        app.PLATFORM = "Eureka base"
        app.set_config(conf_path, conf, self.fail)
        app.set_base_url('http://localhost/')  # dummy server host
        app.set_locale(i18n.Locale('en', 'US'))  # Set the default Locale

        # install the configuration
        registry.configure(app.configuration)

        # configure the security manager
        security.set_manager(app.security)
Example #3
0
 def test_validate_invalid_chart_config(self):
     config_filepath = self._get_filepath('invalid_chart_config.conf')
     conf = self._load_config(config_filepath)
     test_app = BaseApplication(Shell)
     with self.assertRaises(ConfigError):
         test_app._validate_config(conf, config_filepath, config_error)
Example #4
0
 def test_validate_valid_config(self):
     config_filepath = self._get_filepath('valid_config.conf')
     conf = self._load_config(config_filepath)
     test_app = BaseApplication(Shell)
     result = test_app._validate_config(conf, config_filepath, config_error)
     self.assertTrue(result)
 def test_validate_invalid_chart_config(self):
     config_filepath = self._get_filepath('invalid_chart_config.conf')
     conf = self._load_config(config_filepath)
     test_app = BaseApplication(Shell)
     with self.assertRaises(ConfigError):
         test_app._validate_config(conf, config_filepath, config_error)
 def test_validate_valid_config(self):
     config_filepath = self._get_filepath('valid_config.conf')
     conf = self._load_config(config_filepath)
     test_app = BaseApplication(Shell)
     result = test_app._validate_config(conf, config_filepath, config_error)
     self.assertTrue(result)