예제 #1
0
파일: test_config.py 프로젝트: bladams/keg
 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}'
예제 #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}'
예제 #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
예제 #4
0
파일: test_config.py 프로젝트: bladams/keg
    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
예제 #5
0
파일: test_config.py 프로젝트: sacherjj/keg
    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
예제 #6
0
파일: test_config.py 프로젝트: sacherjj/keg
 def test_config_substitutions(self):
     config = Config('', {})
     config['testvalue'] = '{not there}'
     config.init_app(None, 'fakeapp', '', False)
     assert config['testvalue'] == '{not there}'
예제 #7
0
파일: test_config.py 프로젝트: sacherjj/keg
 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'
예제 #8
0
파일: test_config.py 프로젝트: bladams/keg
 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'