From 7350ccbffefdf81992b3ccd8aac814f3bb954be8 Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Tue, 25 Nov 2008 11:54:51 -0700 Subject: Started fleshing out doodles in xmlrpc.execute() --- tests/test_ipa_server/test_rpc.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests') diff --git a/tests/test_ipa_server/test_rpc.py b/tests/test_ipa_server/test_rpc.py index 56ad3f06..6c46b130 100644 --- a/tests/test_ipa_server/test_rpc.py +++ b/tests/test_ipa_server/test_rpc.py @@ -26,6 +26,20 @@ from ipalib import errors, Command from ipa_server import rpc +def test_params_2_args_options(): + """ + Test the `ipa_server.rpc.params_2_args_options` function. + """ + f = rpc.params_2_args_options + args = ('Hello', u'world!') + options = dict(one=1, two=u'Two', three='Three') + assert f(tuple()) == (tuple(), dict()) + assert f(args) == (args, dict()) + assert f((options,)) == (tuple(), options) + assert f(args + (options,)) == (args, options) + assert f((options,) + args) == ((options,) + args, dict()) + + class test_xmlrpc(PluginTester): """ Test the `ipa_server.rpc.xmlrpc` plugin. -- cgit