From 66faffdfb09ee2bcee1b405c78b37e340bc043aa Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Fri, 12 Dec 2008 03:38:02 -0700 Subject: New Param: cleanup up readability of Param.__init__(); added unit tests for unknown kwargs --- tests/test_ipalib/test_parameter.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/test_ipalib/test_parameter.py') diff --git a/tests/test_ipalib/test_parameter.py b/tests/test_ipalib/test_parameter.py index ddc938d4..855e2cbc 100644 --- a/tests/test_ipalib/test_parameter.py +++ b/tests/test_ipalib/test_parameter.py @@ -154,6 +154,15 @@ class test_Param(ClassChecker): Subclass('my_param', **kw) # Test when using unknown kwargs: + e = raises(TypeError, self.cls, 'my_param', + flags=['hello', 'world'], + whatever=u'Hooray!', + ) + assert str(e) == \ + "Param('my_param'): takes no such kwargs: 'whatever'" + e = raises(TypeError, self.cls, 'my_param', great='Yes', ape='he is!') + assert str(e) == \ + "Param('my_param'): takes no such kwargs: 'ape', 'great'" def test_convert_scalar(self): """ -- cgit