示例#1
0
    def test_init_configs(self):
        app = Keg(__name__, config={'ABC': 123}).init()
        assert app.config['ABC'] == 123

        app = Keg(__name__).init(config={'ABC': 123})
        assert app.config['ABC'] == 123

        class TestingPrepConfigApp(Keg):
            import_name = __name__
        app = TestingPrepConfigApp.testing_prep(ABC=123)
        assert app.config['ABC'] == 123
示例#2
0
 def test_environ_profile(self):
     app = Keg('tempapp').init(use_test_profile=True)
     assert app.config.profile == 'bar'
示例#3
0
 def test_app_params_profile(self):
     app = Keg(__name__).init(config_profile='Foo', use_test_profile=True)
     assert app.config.profile == 'Foo'
示例#4
0
    def test_default_profile(self):
        app = Keg(__name__).init()
        assert app.config.profile is None

        # this key comes from Keg's DefaultProfile
        assert 'KEG_ENDPOINTS' in app.config
示例#5
0
 def test_init_called_twice_error(self):
     app = Keg(__name__)
     app.init()
     app.init()
示例#6
0
文件: test_app.py 项目: sacherjj/keg
 def test_init_called_twice_error(self):
     app = Keg(__name__)
     app.init(use_test_profile=True)
     app.init(use_test_profile=True)