test_external: Assert that requests don't get rate limited too soon.

This assertion was missing in do_test_hit_ratelimits, allowing a test to
pass even if the requests started being blocked sooner than expected.
This commit is contained in:
Mateusz Mandera 2021-08-06 11:11:08 +02:00 committed by Mateusz Mandera
parent 0d6bb6d53b
commit 29b3e81dd4
1 changed files with 2 additions and 0 deletions

View File

@ -155,6 +155,8 @@ class RateLimitTests(ZulipTestCase):
for i in range(6):
with mock.patch("time.time", return_value=(start_time + i * 0.1)):
result = request_func()
if i < 5:
self.assertNotEqual(result.status_code, 429)
assert_func(result)