def test_init_locations(self): locations = [DEFAULT_CONFIG, SYSTEM_CONFIG, USER_CONFIG] self.assertEquals(ConfigurationLoader.init_locations(), locations) locations = [self.config_path] self.assertEquals(ConfigurationLoader.init_locations(locations), locations)
def test_load_with_extra_custom(self): my_config = {'key': 'value'} config = ConfigurationLoader.load(my_config) self.assert_config(config) value = config.get('key', None) self.assertIsNotNone(value) self.assertEquals(value, my_config.get('key'))
def test_load_with_extra_custom(self): my_config = {'key': 'value'} config = ConfigurationLoader.load(my_config) self.assert_config(config) value = config.get('key', None) self.assertIsNotNone(value) self.assertEquals(value, my_config.get('key'))
def test_load(self): self.assert_config(ConfigurationLoader.load())
def test_validate_data(self): try: ConfigurationLoader.validate({}, []) except TypeError: self.fail()
def test_init_locations_with_new_location(self): locations = [self.config_path] self.assertEquals(ConfigurationLoader.init_locations(locations), locations)
def test_init_locations_with_defaults(self): locations = [DEFAULT_CONFIG, SYSTEM_CONFIG, USER_CONFIG] self.assertEquals(ConfigurationLoader.init_locations(), locations)
def test_init_config_with_new_config(self): config = {'a': 'b'} self.assertEquals(ConfigurationLoader.init_config(config), config)
def test_init_config_with_defaults(self): self.assertEquals(ConfigurationLoader.init_config(), {})
def test_init_locations_with_defaults(self): locations = [DEFAULT_CONFIG, SYSTEM_CONFIG, USER_CONFIG] self.assertEquals(ConfigurationLoader.init_locations(), locations)
def test_load_with_override_custom(self): config = self.create_config('pt-br', 'espeak') config = ConfigurationLoader.load(config) self.assert_config(config)
def test_load_with_override_default(self): config = self.create_config() config = ConfigurationLoader.load(config, [self.config_path]) self.assert_config(config, 'pt-br', 'espeak')
def test_load(self): self.assert_config(ConfigurationLoader.load())
def test_validate_data(self): try: ConfigurationLoader.validate_data({}, []) except TypeError: self.fail()
def test_init_locations_with_new_location(self): locations = [self.config_path] self.assertEquals(ConfigurationLoader.init_locations(locations), locations)
def test_load_with_override_custom(self): config = self.create_config('pt-br', 'espeak', 'f1') config = ConfigurationLoader.load(config) self.assert_config(config)
def test_init_config_with_defaults(self): self.assertEquals(ConfigurationLoader.init_config(), {})
def test_load_with_override_default(self): config = self.create_config() config = ConfigurationLoader.load(config, [self.config_path]) self.assert_config(config, 'pt-br', 'espeak', 'f1')
def test_init_config_with_new_config(self): config = {'a': 'b'} self.assertEquals(ConfigurationLoader.init_config(config), config)
def test_load_with_invalid_locations_path(self): locations = ['./invalid/mycroft.conf', './invalid_mycroft.conf'] config = ConfigurationLoader.load(None, locations, False) self.assertEquals(config, {})
def test_load_with_invalid_locations_path(self): locations = ['./invalid/mycroft.ini', './invalid_mycroft.ini'] config = ConfigurationLoader.load(None, locations, False) self.assertEquals(config, {})