summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-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):
"""