diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_ipalib/test_frontend.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_ipalib/test_frontend.py b/tests/test_ipalib/test_frontend.py index 7760ffbe3..966b5e935 100644 --- a/tests/test_ipalib/test_frontend.py +++ b/tests/test_ipalib/test_frontend.py @@ -115,11 +115,21 @@ class test_DefaultFrom(ClassChecker): kw_copy = dict(kw) del kw_copy[key] assert o(**kw_copy) is None + + # Test using implied keys: o = self.cls(lambda first, last: first[0] + last) assert o(first='john', last='doe') == 'jdoe' assert o(first='', last='doe') is None assert o(one='john', two='doe') is None + # Test that co_varnames slice is used: + def callback2(first, last): + letter = first[0] + return letter + last + o = self.cls(callback2) + assert o.keys == ('first', 'last') + assert o(first='john', last='doe') == 'jdoe' + def test_parse_param_spec(): """ |