def test_CheckDuplicateConfigs_ok(self): configs = ast.literal_eval(mb_unittest.TEST_CONFIG) config_configs = configs['configs'] mixins = configs['mixins'] grouping = configs['masters'] errs = [] validation.CheckDuplicateConfigs(errs, config_configs, mixins, grouping, mb.FlattenConfig) self.assertEqual(errs, [])
def test_CheckDuplicateConfigs_dups(self): configs = ast.literal_eval(mb_unittest.TEST_DUP_CONFIG) config_configs = configs['configs'] mixins = configs['mixins'] grouping = configs['masters'] errs = [] validation.CheckDuplicateConfigs(errs, config_configs, mixins, grouping, mb.FlattenConfig) self.assertIn( 'Duplicate configs detected. When evaluated fully, the ' 'following configs are all equivalent: \'some_config\', ' '\'some_other_config\'. Please consolidate these configs ' 'into only one unique name per configuration value.', errs)