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:
Petr Viktorin
2012-03-27 09:27:11 -04:00
committed by Rob Crittenden
parent 689bea6575
commit 6d0e4e58fc
20 changed files with 340 additions and 185 deletions

View File

@@ -52,21 +52,24 @@ class test_privilege(Declarative):
dict(
desc='Try to retrieve non-existent %r' % privilege1,
command=('privilege_show', [privilege1], {}),
expected=errors.NotFound(reason='no such entry'),
expected=errors.NotFound(
reason=u'%s: privilege not found' % privilege1),
),
dict(
desc='Try to update non-existent %r' % privilege1,
command=('privilege_mod', [privilege1], dict(description=u'Foo')),
expected=errors.NotFound(reason='no such entry'),
expected=errors.NotFound(
reason=u'%s: privilege not found' % privilege1),
),
dict(
desc='Try to delete non-existent %r' % privilege1,
command=('privilege_del', [privilege1], {}),
expected=errors.NotFound(reason='no such entry'),
expected=errors.NotFound(
reason=u'%s: privilege not found' % privilege1),
),