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 --- tests/test_xmlrpc/test_hbacsvcgroup_plugin.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'tests/test_xmlrpc/test_hbacsvcgroup_plugin.py') diff --git a/tests/test_xmlrpc/test_hbacsvcgroup_plugin.py b/tests/test_xmlrpc/test_hbacsvcgroup_plugin.py index ba30854a7..1552f46ce 100644 --- a/tests/test_xmlrpc/test_hbacsvcgroup_plugin.py +++ b/tests/test_xmlrpc/test_hbacsvcgroup_plugin.py @@ -47,7 +47,8 @@ class test_hbacsvcgroup(Declarative): dict( desc='Try to retrieve non-existent %r' % hbacsvcgroup1, command=('hbacsvcgroup_show', [hbacsvcgroup1], {}), - expected=errors.NotFound(reason='no such entry'), + expected=errors.NotFound( + reason=u'%s: HBAC service group not found' % hbacsvcgroup1), ), @@ -56,14 +57,16 @@ class test_hbacsvcgroup(Declarative): command=('hbacsvcgroup_mod', [hbacsvcgroup1], dict(description=u'Updated hbacsvcgroup 1') ), - expected=errors.NotFound(reason='no such entry'), + expected=errors.NotFound( + reason=u'%s: HBAC service group not found' % hbacsvcgroup1), ), dict( desc='Try to delete non-existent %r' % hbacsvcgroup1, command=('hbacsvcgroup_del', [hbacsvcgroup1], {}), - expected=errors.NotFound(reason='no such entry'), + expected=errors.NotFound( + reason=u'%s: HBAC service group not found' % hbacsvcgroup1), ), @@ -91,7 +94,9 @@ class test_hbacsvcgroup(Declarative): command=('hbacsvcgroup_add', [hbacsvcgroup1], dict(description=u'Test hbacsvcgroup 1') ), - expected=errors.DuplicateEntry(), + expected=errors.DuplicateEntry( + message=u'HBAC service group with name "%s" already exists' % + hbacsvcgroup1), ), -- cgit