mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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
This commit is contained in:
committed by
Rob Crittenden
parent
689bea6575
commit
6d0e4e58fc
@@ -61,21 +61,24 @@ class test_permission(Declarative):
|
||||
dict(
|
||||
desc='Try to retrieve non-existent %r' % permission1,
|
||||
command=('permission_show', [permission1], {}),
|
||||
expected=errors.NotFound(reason='no such entry'),
|
||||
expected=errors.NotFound(
|
||||
reason=u'%s: permission not found' % permission1),
|
||||
),
|
||||
|
||||
|
||||
dict(
|
||||
desc='Try to update non-existent %r' % permission1,
|
||||
command=('permission_mod', [permission1], dict(permissions=u'all')),
|
||||
expected=errors.NotFound(reason='no such entry'),
|
||||
expected=errors.NotFound(
|
||||
reason=u'%s: permission not found' % permission1),
|
||||
),
|
||||
|
||||
|
||||
dict(
|
||||
desc='Try to delete non-existent %r' % permission1,
|
||||
command=('permission_del', [permission1], {}),
|
||||
expected=errors.NotFound(reason='no such entry'),
|
||||
expected=errors.NotFound(
|
||||
reason=u'%s: permission not found' % permission1),
|
||||
),
|
||||
|
||||
|
||||
@@ -516,21 +519,24 @@ class test_permission(Declarative):
|
||||
dict(
|
||||
desc='Try to delete non-existent %r' % permission1,
|
||||
command=('permission_del', [permission1], {}),
|
||||
expected=errors.NotFound(reason='no such entry'),
|
||||
expected=errors.NotFound(
|
||||
reason=u'%s: permission not found' % permission1),
|
||||
),
|
||||
|
||||
|
||||
dict(
|
||||
desc='Try to retrieve non-existent %r' % permission1,
|
||||
command=('permission_show', [permission1], {}),
|
||||
expected=errors.NotFound(reason='no such entry'),
|
||||
expected=errors.NotFound(
|
||||
reason=u'%s: permission not found' % permission1),
|
||||
),
|
||||
|
||||
|
||||
dict(
|
||||
desc='Try to update non-existent %r' % permission1,
|
||||
command=('permission_mod', [permission1], dict(rename=u'Foo')),
|
||||
expected=errors.NotFound(reason='no such entry'),
|
||||
expected=errors.NotFound(
|
||||
reason=u'%s: permission not found' % permission1),
|
||||
),
|
||||
|
||||
|
||||
@@ -575,7 +581,7 @@ class test_permission(Declarative):
|
||||
permissions=u'write',
|
||||
)
|
||||
),
|
||||
expected=errors.NotFound(reason='group not found'),
|
||||
expected=errors.NotFound(reason=u'nonexisting: group not found'),
|
||||
),
|
||||
|
||||
dict(
|
||||
@@ -603,8 +609,9 @@ class test_permission(Declarative):
|
||||
|
||||
dict(
|
||||
desc='Try to update non-existent memberof of %r' % permission1,
|
||||
command=('permission_mod', [permission1], dict(memberof=u'nonexisting')),
|
||||
expected=errors.NotFound(reason='group not found'),
|
||||
command=('permission_mod', [permission1], dict(
|
||||
memberof=u'nonexisting')),
|
||||
expected=errors.NotFound(reason=u'nonexisting: group not found'),
|
||||
),
|
||||
|
||||
dict(
|
||||
|
||||
Reference in New Issue
Block a user