Beispiel #1
0
    def test_get_config_object(self, monkeypatch):
        '''Simple test to grab a config object, will return default config
        values.
        '''

        monkeypatch.setattr(config, 'CONF_DIRS', [])
        ref_conf = config.ConfigData()

        test_conf = config.get_config()

        assert ref_conf.META_DATA == test_conf.META_DATA
Beispiel #2
0
    def test_merge_config_file(self, tmpdir):
        '''merge loaded config object with defaults, make sure that the defaults
        are overridden.
        '''

        refdir = tmpdir.mkdir('conf')
        ref_conf_filename = '{}/{}'.format(refdir, config.CONF_FILE)
        with open(ref_conf_filename, 'w+') as ref_conffile:
            ref_conffile.write(REF_CONF_CONTENTS)

        test_config_obj = config._load_config(ref_conf_filename)

        test_config = config.ConfigData()
        assert test_config.DATA_DIR != REF_DATA_DIR

        test_config.merge_object(test_config_obj)
        assert test_config.DATA_DIR == REF_DATA_DIR
Beispiel #3
0
 def setup_method(self, method):
     self.conf = config.ConfigData()