Increase timeout from 2s to 5s

This commit is contained in:
Kevin Fronczak
2020-05-26 21:00:15 +00:00
parent bc85779272
commit 1e00f657a7
2 changed files with 20 additions and 1 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ from blinkpy.helpers.constants import DEFAULT_URL
_LOGGER = logging.getLogger(__name__)
MIN_THROTTLE_TIME = 2
MIN_THROTTLE_TIME = 5
def request_login(
+19
View File
@@ -67,6 +67,25 @@ class TestUtil(unittest.TestCase):
self.assertEqual(throttled(), True)
self.assertEqual(throttled(), None)
def test_throttle_multiple_objects(self):
"""Test that function is throttled even if called by multiple objects."""
@Throttle(seconds=5)
def test_throttle_method():
return True
class Tester:
"""A tester class for throttling."""
def test(self):
"""Test function for throttle."""
return test_throttle_method()
tester1 = Tester()
tester2 = Tester()
self.assertEqual(tester1.test(), True)
self.assertEqual(tester2.test(), None)
def test_throttle_on_two_methods(self):
"""Test that throttle works for multiple methods."""