summaryrefslogtreecommitdiffstats
path: root/tests/test_xmlrpc
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2012-07-04 08:52:47 -0400
committerMartin Kosek <mkosek@redhat.com>2012-09-03 18:16:12 +0200
commita95eaeac8e07b8ccd173b0f408575cc9a0d508fc (patch)
tree6cd7e09e02d313a3d382d1efbb27588aab27a866 /tests/test_xmlrpc
parent4f03aed5e603389bbb149464eee597180470ad70 (diff)
downloadfreeipa.git-a95eaeac8e07b8ccd173b0f408575cc9a0d508fc.tar.gz
freeipa.git-a95eaeac8e07b8ccd173b0f408575cc9a0d508fc.tar.xz
freeipa.git-a95eaeac8e07b8ccd173b0f408575cc9a0d508fc.zip
Internationalization for public errors
Currently, we throw many public exceptions without proper i18n. Wrap natural-language error messages in _() so they can be translated. In the service plugin, raise NotFound errors using handle_not_found helper so the error message contains the offending service. Use ScriptError instead of NotFoundError in bindinstance install. https://fedorahosted.org/freeipa/ticket/1953
Diffstat (limited to 'tests/test_xmlrpc')
-rw-r--r--tests/test_xmlrpc/test_service_plugin.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/test_xmlrpc/test_service_plugin.py b/tests/test_xmlrpc/test_service_plugin.py
index e06132fe..a76bc918 100644
--- a/tests/test_xmlrpc/test_service_plugin.py
+++ b/tests/test_xmlrpc/test_service_plugin.py
@@ -69,14 +69,16 @@ class test_service(Declarative):
dict(
desc='Try to update non-existent %r' % service1,
command=('service_mod', [service1], dict(usercertificate=servercert)),
- expected=errors.NotFound(reason='no such entry'),
+ expected=errors.NotFound(
+ reason=u'%s: service not found' % service1),
),
dict(
desc='Try to delete non-existent %r' % service1,
command=('service_del', [service1], {}),
- expected=errors.NotFound(reason='no such entry'),
+ expected=errors.NotFound(
+ reason=u'%s: service not found' % service1),
),
@@ -457,14 +459,16 @@ class test_service(Declarative):
dict(
desc='Try to update non-existent %r' % service1,
command=('service_mod', [service1], dict(usercertificate=servercert)),
- expected=errors.NotFound(reason='no such entry'),
+ expected=errors.NotFound(
+ reason=u'%s: service not found' % service1),
),
dict(
desc='Try to delete non-existent %r' % service1,
command=('service_del', [service1], {}),
- expected=errors.NotFound(reason='no such entry'),
+ expected=errors.NotFound(
+ reason=u'%s: service not found' % service1),
),