summaryrefslogtreecommitdiffstats
path: root/tests/test_xmlrpc/test_role_plugin.py
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2012-03-27 09:27:11 -0400
committerRob Crittenden <rcritten@redhat.com>2012-04-10 21:05:45 -0400
commit6d0e4e58fcc33f8c4514750eb6e5d7b5882efef8 (patch)
treed576654b11cb834c01701e855bbf324aa1ce2171 /tests/test_xmlrpc/test_role_plugin.py
parent689bea65757bae66b387acde3ffc7897e6b0ec3b (diff)
downloadfreeipa-6d0e4e58fcc33f8c4514750eb6e5d7b5882efef8.tar.gz
freeipa-6d0e4e58fcc33f8c4514750eb6e5d7b5882efef8.tar.xz
freeipa-6d0e4e58fcc33f8c4514750eb6e5d7b5882efef8.zip
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
Diffstat (limited to 'tests/test_xmlrpc/test_role_plugin.py')
-rw-r--r--tests/test_xmlrpc/test_role_plugin.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/tests/test_xmlrpc/test_role_plugin.py b/tests/test_xmlrpc/test_role_plugin.py
index 8a5dede23..62bc6eade 100644
--- a/tests/test_xmlrpc/test_role_plugin.py
+++ b/tests/test_xmlrpc/test_role_plugin.py
@@ -61,28 +61,28 @@ class test_role(Declarative):
dict(
desc='Try to retrieve non-existent %r' % role1,
command=('role_show', [role1], {}),
- expected=errors.NotFound(reason='no such entry'),
+ expected=errors.NotFound(reason=u'%s: role not found' % role1),
),
dict(
desc='Try to update non-existent %r' % role1,
command=('role_mod', [role1], dict(description=u'Foo')),
- expected=errors.NotFound(reason='no such entry'),
+ expected=errors.NotFound(reason=u'%s: role not found' % role1),
),
dict(
desc='Try to delete non-existent %r' % role1,
command=('role_del', [role1], {}),
- expected=errors.NotFound(reason='no such entry'),
+ expected=errors.NotFound(reason=u'%s: role not found' % role1),
),
dict(
desc='Try to rename non-existent %r' % role1,
command=('role_mod', [role1], dict(setattr=u'cn=%s' % renamedrole1)),
- expected=errors.NotFound(reason='no such entry'),
+ expected=errors.NotFound(reason=u'%s: role not found' % role1),
),
@@ -103,7 +103,8 @@ class test_role(Declarative):
command=('role_add', [invalidrole1],
dict(description=u'role desc 1')
),
- expected=errors.ValidationError(name='cn', error='Leading and trailing spaces are not allowed'),
+ expected=errors.ValidationError(name='name',
+ error=u'Leading and trailing spaces are not allowed'),
),
@@ -516,21 +517,21 @@ class test_role(Declarative):
dict(
desc='Try to delete non-existent %r' % role1,
command=('role_del', [role1], {}),
- expected=errors.NotFound(reason='no such entry'),
+ expected=errors.NotFound(reason=u'%s: role not found' % role1),
),
dict(
- desc='Try to retrieve non-existent %r' % role1,
- command=('role_show', [group1], {}),
- expected=errors.NotFound(reason='no such entry'),
+ desc='Try to show non-existent %r' % role1,
+ command=('role_show', [role1], {}),
+ expected=errors.NotFound(reason=u'%s: role not found' % role1),
),
dict(
desc='Try to update non-existent %r' % role1,
command=('role_mod', [role1], dict(description=u'Foo')),
- expected=errors.NotFound(reason='no such entry'),
+ expected=errors.NotFound(reason=u'%s: role not found' % role1),
),