Throttle for two methonds in same class
This commit is contained in:
parent
d6a14a1767
commit
562db5ea4c
2 changed files with 28 additions and 8 deletions
|
@ -238,3 +238,20 @@ class TestUtil(unittest.TestCase):
|
|||
|
||||
self.assertTrue(throttled())
|
||||
self.assertIsNone(throttled())
|
||||
|
||||
def test_throttle_on_two_method(self):
|
||||
""" Test that throttle works when wrapping two methods. """
|
||||
|
||||
class Tester(object):
|
||||
@util.Throttle(timedelta(seconds=1))
|
||||
def hello(self):
|
||||
return True
|
||||
|
||||
@util.Throttle(timedelta(seconds=1))
|
||||
def goodbye(self):
|
||||
return True
|
||||
|
||||
tester = Tester()
|
||||
|
||||
self.assertTrue(tester.hello())
|
||||
self.assertTrue(tester.goodbye())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue