summaryrefslogtreecommitdiffstats
path: root/tests/test_ipalib/test_rpc.py
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2009-01-22 15:41:54 -0700
committerRob Crittenden <rcritten@redhat.com>2009-02-03 15:29:01 -0500
commit24b6cb89d443384cb432f01265c45bc18d9cf2fc (patch)
tree50aa6e4b2ce4863d018644026c34085347263c74 /tests/test_ipalib/test_rpc.py
parent9f48612a56b6e760aa06a9af2071f1b50f413f27 (diff)
downloadfreeipa-24b6cb89d443384cb432f01265c45bc18d9cf2fc.tar.gz
freeipa-24b6cb89d443384cb432f01265c45bc18d9cf2fc.tar.xz
freeipa-24b6cb89d443384cb432f01265c45bc18d9cf2fc.zip
Further migration toward new xmlrcp code; fixed problem with unicode Fault.faultString; fixed problem where ServerProxy method was not called correctly
Diffstat (limited to 'tests/test_ipalib/test_rpc.py')
-rw-r--r--tests/test_ipalib/test_rpc.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/tests/test_ipalib/test_rpc.py b/tests/test_ipalib/test_rpc.py
index 30175e3bf..351f483be 100644
--- a/tests/test_ipalib/test_rpc.py
+++ b/tests/test_ipalib/test_rpc.py
@@ -171,11 +171,13 @@ def test_xml_loads():
assert_equal(tup[0], params)
# Test un-serializing an RPC response containing a Fault:
- fault = Fault(69, unicode_str)
- data = dumps(fault, methodresponse=True, allow_none=True)
- e = raises(Fault, f, data)
- assert e.faultCode == 69
- assert_equal(e.faultString, unicode_str)
+ for error in (unicode_str, u'hello'):
+ fault = Fault(69, error)
+ data = dumps(fault, methodresponse=True, allow_none=True, encoding='UTF-8')
+ e = raises(Fault, f, data)
+ assert e.faultCode == 69
+ assert_equal(e.faultString, error)
+ assert type(e.faultString) is unicode
class test_xmlclient(PluginTester):
@@ -227,19 +229,19 @@ class test_xmlclient(PluginTester):
context.xmlconn = DummyClass(
(
'user_add',
- (rpc.xml_wrap(params),),
+ rpc.xml_wrap(params),
{},
rpc.xml_wrap(result),
),
(
'user_add',
- (rpc.xml_wrap(params),),
+ rpc.xml_wrap(params),
{},
Fault(3007, u"'four' is required"), # RequirementError
),
(
'user_add',
- (rpc.xml_wrap(params),),
+ rpc.xml_wrap(params),
{},
Fault(700, u'no such error'), # There is no error 700
),