Esempio n. 1
0
 def test_config_substitutions(self):
     config = Config('', {})
     config['testvalue'] = '{not there}'
     config.init_app(None, 'fakeapp', '')
     assert config['KEG_LOG_DPATH'] == config.dirs.user_log_dir
     assert config['KEG_LOG_FNAME'] == 'fakeapp.log'
     assert config['testvalue'] == '{not there}'
Esempio n. 2
0
 def test_config_substitutions(self):
     config = Config('', {})
     config['testvalue'] = '{not there}'
     config.init_app(None, 'fakeapp', '', False)
     assert config['KEG_LOG_DPATH'] == config.dirs.user_log_dir
     assert config['KEG_LOG_FNAME'] == 'fakeapp.log'
     assert config['testvalue'] == '{not there}'
Esempio n. 3
0
    def test_default_config_objects_no_profile(self):
        config = Config('', {})
        config.init_app(None, 'fakeapp', '', False)

        # No profile given, so only the default profiles from Keg and the App should be tried.
        expected = [
            'keg.config.DefaultProfile', 'fakeapp.config.DefaultProfile'
        ]
        assert config.default_config_locations_parsed() == expected
Esempio n. 4
0
    def test_default_config_objects_no_profile(self):
        config = Config('', {})
        config.init_app(None, 'fakeapp', '')

        # No profile given, so only the default profiles from Keg and the App should be tried.
        expected = [
            'keg.config.DefaultProfile',
            'fakeapp.config.DefaultProfile'
        ]
        assert config.default_config_locations_parsed() == expected
Esempio n. 5
0
    def test_default_config_objects_with_profile(self):
        config = Config('', {})

        config.init_app('SomeProfile', 'fakeapp', '', False)

        expected = [
            'keg.config.DefaultProfile',
            'keg.config.SomeProfile',
            'fakeapp.config.DefaultProfile',
            'fakeapp.config.SomeProfile',
        ]
        assert config.default_config_locations_parsed() == expected
Esempio n. 6
0
 def test_config_substitutions(self):
     config = Config('', {})
     config['testvalue'] = '{not there}'
     config.init_app(None, 'fakeapp', '', False)
     assert config['testvalue'] == '{not there}'
Esempio n. 7
0
 def test_profile_from_config_file(self):
     config_file_objs = [('/fake/path', dict(DEFAULT_PROFILE='baz'))]
     config = Config('', {})
     config.init_app(None, __name__, '', False, config_file_objs)
     assert config.profile == 'baz'
Esempio n. 8
0
 def test_profile_from_config_file(self):
     config_file_objs = [('/fake/path', dict(DEFAULT_PROFILE='baz'))]
     config = Config('', {})
     config.init_app(None, __name__, '', config_file_objs)
     assert config.profile == 'baz'