From cf7e4c1038a5240f00342d284cf7a6be812322b4 Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Thu, 4 Sep 2008 02:30:40 +0000 Subject: 252: Added Command.convert() method; added corresponding unit tests --- ipalib/tests/test_public.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'ipalib/tests') 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. -- cgit