def test_add_group_vars_group_does_not_exist_raises_exception(self): from inventory import GroupDoesNotExist inv = AwxInventory() test_vars = { 'var1': 'val1', 'var2': 'val2', } with self.assertRaises(GroupDoesNotExist): inv.add_group_vars('group1', test_vars)
def test_add_group_vars(self): inv = AwxInventory() inv.add_group('group1') test_vars = { 'var1': 'val1', 'var2': 'val2', } inv.add_group_vars('group1', test_vars) test_dict = {'group1': {'vars': test_vars}} self.assertDictEqual(inv.groups, test_dict)