summaryrefslogtreecommitdiffstats
path: root/ipatests/test_xmlrpc/test_batch_plugin.py
diff options
context:
space:
mode:
authorJan Cholasta <jcholast@redhat.com>2016-05-18 09:42:56 +0200
committerJan Cholasta <jcholast@redhat.com>2016-05-25 16:06:26 +0200
commite0275abe6f5192e68b7f57acf37b01aaa89003ea (patch)
tree3023bbb3db7e3369e865eabfe6b878e09cf7d38c /ipatests/test_xmlrpc/test_batch_plugin.py
parent861294c0d62891dc9977e7203cc07496e35ec939 (diff)
downloadfreeipa-e0275abe6f5192e68b7f57acf37b01aaa89003ea.tar.gz
freeipa-e0275abe6f5192e68b7f57acf37b01aaa89003ea.tar.xz
freeipa-e0275abe6f5192e68b7f57acf37b01aaa89003ea.zip
rpc: include structured error information in responses
Include keyword arguments of exceptions in RPC responses. This is limited to JSON-RPC, as XML-RPC does not support additional data in error responses. Include keyword arguments of messages in RPC responses. Include keyword arguments of exceptions in batch command result. https://fedorahosted.org/freeipa/ticket/4739 Reviewed-By: David Kupka <dkupka@redhat.com>
Diffstat (limited to 'ipatests/test_xmlrpc/test_batch_plugin.py')
-rw-r--r--ipatests/test_xmlrpc/test_batch_plugin.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/ipatests/test_xmlrpc/test_batch_plugin.py b/ipatests/test_xmlrpc/test_batch_plugin.py
index 92b4af54a..c2d108fb9 100644
--- a/ipatests/test_xmlrpc/test_batch_plugin.py
+++ b/ipatests/test_xmlrpc/test_batch_plugin.py
@@ -128,11 +128,17 @@ class test_batch(Declarative):
error=u'%s: group not found' % group1,
error_name=u'NotFound',
error_code=4001,
+ error_kw=dict(
+ reason=u'%s: group not found' % group1,
+ ),
),
dict(
error=u'%s: group not found' % group1,
error_name=u'NotFound',
error_code=4001,
+ error_kw=dict(
+ reason=u'%s: group not found' % group1,
+ ),
),
],
),
@@ -152,6 +158,9 @@ class test_batch(Declarative):
error=u'%s: group not found' % group1,
error_name=u'NotFound',
error_code=4001,
+ error_kw=dict(
+ reason=u'%s: group not found' % group1,
+ ),
),
dict(
value=group1,
@@ -198,36 +207,58 @@ class test_batch(Declarative):
error=u"unknown command 'nonexistent_ipa_command'",
error_name=u'CommandError',
error_code=905,
+ error_kw=dict(
+ name=u'nonexistent_ipa_command',
+ ),
),
dict(
error=u"unknown command 'user-del'",
error_name=u'CommandError',
error_code=905,
+ error_kw=dict(
+ name=u'user-del',
+ ),
),
dict(
error=u"'method' is required",
error_name=u'RequirementError',
error_code=3007,
+ error_kw=dict(
+ name=u'method',
+ ),
),
dict(
error=u"'params' is required",
error_name=u'RequirementError',
error_code=3007,
+ error_kw=dict(
+ name=u'params',
+ ),
),
dict(
error=u"'givenname' is required",
error_name=u'RequirementError',
error_code=3007,
+ error_kw=dict(
+ name=u'givenname',
+ ),
),
dict(
error=u"'sn' is required",
error_name=u'RequirementError',
error_code=3007,
+ error_kw=dict(
+ name=u'sn',
+ ),
),
dict(
error=Fuzzy(u"invalid 'gid'.*"),
error_name=u'ConversionError',
error_code=3008,
+ error_kw=dict(
+ name=u'gid',
+ error=Fuzzy(u'.*'),
+ ),
),
),
),