summaryrefslogtreecommitdiffstats
path: root/tests/test_ipalib/test_frontend.py
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2008-11-12 09:55:11 -0700
committerJason Gerard DeRose <jderose@redhat.com>2008-11-12 09:55:11 -0700
commitf04aaff97c9c8c22b36706f2c6d4de6f23d06b95 (patch)
tree64937c8d6f7d394f4c077585d124ecd0331b1f80 /tests/test_ipalib/test_frontend.py
parent09161e399a61e2a548e9efb3c3abb2c7b47d5520 (diff)
downloadfreeipa-f04aaff97c9c8c22b36706f2c6d4de6f23d06b95.tar.gz
freeipa-f04aaff97c9c8c22b36706f2c6d4de6f23d06b95.tar.xz
freeipa-f04aaff97c9c8c22b36706f2c6d4de6f23d06b95.zip
output_for_cli signature is now output_for_cli(textui, result, *args, **options)
Diffstat (limited to 'tests/test_ipalib/test_frontend.py')
-rw-r--r--tests/test_ipalib/test_frontend.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/tests/test_ipalib/test_frontend.py b/tests/test_ipalib/test_frontend.py
index 5a678b5bc..75e098a42 100644
--- a/tests/test_ipalib/test_frontend.py
+++ b/tests/test_ipalib/test_frontend.py
@@ -735,18 +735,17 @@ class test_Command(ClassChecker):
e = raises(errors.ArgumentError, o.args_to_kw, 1, 2, 3)
assert str(e) == 'example takes at most 2 arguments'
- def test_kw_to_args(self):
+ def test_params_2_args_options(self):
"""
- Test the `ipalib.frontend.Command.kw_to_args` method.
+ Test the `ipalib.frontend.Command.params_2_args_options` method.
"""
- assert 'kw_to_args' in self.cls.__public__ # Public
- o = self.get_instance(args=('one', 'two?'))
- assert o.kw_to_args() == (None, None)
- assert o.kw_to_args(whatever='hello') == (None, None)
- assert o.kw_to_args(one='the one') == ('the one', None)
- assert o.kw_to_args(two='the two') == (None, 'the two')
- assert o.kw_to_args(whatever='hello', two='Two', one='One') == \
- ('One', 'Two')
+ assert 'params_2_args_options' in self.cls.__public__ # Public
+ o = self.get_instance(args=['one'], options=['two'])
+ assert o.params_2_args_options({}) == ((None,), dict(two=None))
+ assert o.params_2_args_options(dict(one=1)) == ((1,), dict(two=None))
+ assert o.params_2_args_options(dict(two=2)) == ((None,), dict(two=2))
+ assert o.params_2_args_options(dict(two=2, one=1)) == \
+ ((1,), dict(two=2))
def test_run(self):
"""