Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

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

Mateusz Mandera29b3e81dd4ef
diff --git a/zerver/tests/test_external.py b/zerver/tests/test_external.py
index 880e07e5796..3e8c5222439 100644
--- a/zerver/tests/test_external.py
+++ b/zerver/tests/test_external.py
@@ -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)