115: CLI now parses out kw args; cmd.__call__() now uses print_n_call() to give feedback on the calling

This commit is contained in:
Jason Gerard DeRose
2008-08-12 16:49:23 +00:00
parent bc4b26ffca
commit 99d7638ff5
3 changed files with 30 additions and 18 deletions

View File

@@ -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