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)