summaryrefslogtreecommitdiffstats
path: root/ipalib/tests/test_public.py
diff options
context:
space:
mode:
Diffstat (limited to 'ipalib/tests/test_public.py')
-rw-r--r--ipalib/tests/test_public.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/ipalib/tests/test_public.py b/ipalib/tests/test_public.py
index 012b6253..4df55d2f 100644
--- a/ipalib/tests/test_public.py
+++ b/ipalib/tests/test_public.py
@@ -385,6 +385,25 @@ class test_Command(ClassChecker):
assert isinstance(option, public.Option)
assert option.name == name
+ def test_convert(self):
+ """
+ Tests the `public.Command.convert` method.
+ """
+ assert 'convert' in self.cls.__public__ # Public
+ kw = dict(
+ option0='option0',
+ option1='option1',
+ whatever=False,
+ also=object,
+ )
+ expected = dict(kw)
+ expected.update(dict(option0=u'option0', option1=u'option1'))
+ o = self.subcls()
+ for (key, value) in o.convert(**kw).iteritems():
+ v = expected[key]
+ assert value == v
+ assert type(value) is type(v)
+
def test_normalize(self):
"""
Tests the `public.Command.normalize` method.