Skip to content

Commit

Permalink
added decorator_complex test
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerlaberge committed Jan 13, 2017
1 parent 71f162c commit 10e5561
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/structural_tests/test_decorator.py
Expand Up @@ -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):
"""
Expand Down

0 comments on commit 10e5561

Please sign in to comment.