From 99d7638ff5c5cddb4f23d25ad13ef122476d5679 Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Tue, 12 Aug 2008 16:49:23 +0000 Subject: 115: CLI now parses out kw args; cmd.__call__() now uses print_n_call() to give feedback on the calling --- ipalib/tests/test_cli.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'ipalib/tests/test_cli.py') diff --git a/ipalib/tests/test_cli.py b/ipalib/tests/test_cli.py index b47aff3a..d56a4b19 100644 --- a/ipalib/tests/test_cli.py +++ b/ipalib/tests/test_cli.py @@ -53,3 +53,15 @@ class test_CLI(ClassChecker): api = 'the plugable.API instance' o = self.cls(api) assert read_only(o, 'api') is api + + def test_parse_kw(self): + """ + Tests the `parse_kw` method. + """ + o = self.cls(None) + kw = dict( + hello='world', + how_are='you', + ) + args = tuple('--%s=%s' % (cli.to_cli(k), v) for (k,v) in kw.items()) + assert dict(o.parse_kw(args)) == kw -- cgit