From 6d0e4e58fcc33f8c4514750eb6e5d7b5882efef8 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Tue, 27 Mar 2012 09:27:11 -0400 Subject: Fix expected error messages in tests Have the test suite check error messages. Since XMLRPC doesn't give us structured error information, just compare the resulting text. Fix messages that tests expect to cause. Minor changes: Make netgroup-mod's NotFound message consistent with other objects and methods. In test_automember_plugin, test with nonexistent automember rules of both types, instead of nonexistent users. https://fedorahosted.org/freeipa/ticket/2549 --- ipalib/plugins/netgroup.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ipalib/plugins') diff --git a/ipalib/plugins/netgroup.py b/ipalib/plugins/netgroup.py index 06372a59..693c00c1 100644 --- a/ipalib/plugins/netgroup.py +++ b/ipalib/plugins/netgroup.py @@ -202,7 +202,10 @@ class netgroup_mod(LDAPUpdate): msg_summary = _('Modified netgroup "%(value)s"') def pre_callback(self, ldap, dn, entry_attrs, attrs_list, *keys, **options): - (dn, entry_attrs) = ldap.get_entry(dn, attrs_list) + try: + (dn, entry_attrs) = ldap.get_entry(dn, attrs_list) + except errors.NotFound: + self.obj.handle_not_found(*keys) if is_all(options, 'usercategory') and 'memberuser' in entry_attrs: raise errors.MutuallyExclusiveError(reason="user category cannot be set to 'all' while there are allowed users") if is_all(options, 'hostcategory') and 'memberhost' in entry_attrs: -- cgit