Fix throttle to work on instance-level
This commit is contained in:
parent
8a04e1f5f4
commit
47fc1deecb
2 changed files with 30 additions and 12 deletions
|
@ -218,3 +218,14 @@ class TestUtil(unittest.TestCase):
|
|||
|
||||
self.assertEqual(3, len(calls1))
|
||||
self.assertEqual(2, len(calls2))
|
||||
|
||||
def test_throttle_per_instance(self):
|
||||
""" Test that the throttle method is done per instance of a class. """
|
||||
|
||||
class Tester(object):
|
||||
@util.Throttle(timedelta(seconds=1))
|
||||
def hello(self):
|
||||
return True
|
||||
|
||||
self.assertTrue(Tester().hello())
|
||||
self.assertTrue(Tester().hello())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue