diff --git a/tests/structural_tests/test_decorator.py b/tests/structural_tests/test_decorator.py index f30988e..4270660 100644 --- a/tests/structural_tests/test_decorator.py +++ b/tests/structural_tests/test_decorator.py @@ -118,6 +118,27 @@ def slow_function_false(self, n): self.assertEquals(('foo', True), slow_class.slow_function_true(2)) self.assertEquals((10, False), slow_class.slow_function_false(10)) + def test_decorate_kwargs(self): + """ + Test decorating a function with kwargs + + @raise AssertionError: If the test fails. + """ + class SlowClass(object): + + @self.alert(1) + def slow_function_true(self, n=0): + time.sleep(n) + return 'foo' + + @self.alert(1) + def slow_function_false(self, n=0): + return n + + slow_class = SlowClass() + self.assertEquals(('foo', True), slow_class.slow_function_true(n=2)) + self.assertEquals((10, False), slow_class.slow_function_false(n=10)) + class WrapTestCase(TestCase): """