def test_validate_config_mapping(self): master_config = manager.from_string(self.config) other_config = manager.from_string(NamedConfigTestCase.config) config_mapping = {'other': other_config, MASTER_NAMESPACE: master_config} result = list(config_parse.validate_config_mapping(config_mapping)) assert_equal(len(result), 2) assert_equal(result[0][0], MASTER_NAMESPACE) assert_equal(result[1][0], 'other')
def test_validate_config_mapping(self): master_config = self.config other_config = TestNamedConfig.config config_mapping = { 'other': other_config, MASTER_NAMESPACE: master_config, } result = list(config_parse.validate_config_mapping(config_mapping)) assert_equal(len(result), 2) assert_equal(result[0][0], MASTER_NAMESPACE) assert_equal(result[1][0], 'other')
def test_validate_config_mapping(self): master_config = manager.from_string(self.config) other_config = manager.from_string(NamedConfigTestCase.config) config_mapping = { 'other': other_config, MASTER_NAMESPACE: master_config } result = list(config_parse.validate_config_mapping(config_mapping)) assert_equal(len(result), 2) assert_equal(result[0][0], MASTER_NAMESPACE) assert_equal(result[1][0], 'other')
def test_validate_config_mapping_missing_master(self): config_mapping = {'other': mock.Mock()} seq = config_parse.validate_config_mapping(config_mapping) exception = assert_raises(ConfigError, list, seq) assert_in('requires a MASTER namespace', str(exception))