Skip to content

Commit

Permalink
Omit rate limiter test
Browse files Browse the repository at this point in the history
  • Loading branch information
VadimKovalenkoSNF committed Dec 25, 2024
1 parent acb6351 commit d15ae46
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions src/tests/v1/moderator/test_moderation_event_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,3 @@ def test_create_moderation_event(self):
self.moderation_event_id = result['moderation_id']
print(f'[Contribution Record; moderation id:] {self.moderation_event_id}')

def test_moderation_events_rate_limiting(self):
self.create_moderation_event()
for _ in range(500):
response = requests.get(
f"{self.root_url}/api/v1/moderation-events/{self.moderation_event_id}",
headers=self.basic_headers,
)
if response.status_code == HTTP_429_TOO_MANY_REQUEST:
self.assertEqual(response.status_code, HTTP_429_TOO_MANY_REQUEST, "Expected 429 for rate-limited requests.")
result = response.json()
self.assertIn('Request was throttled', result['detail'], "Error message should be returned when rate-limited.")
break
else:
self.skipTest("Rate limit was not reached; adjust loop count or rate-limit policy if needed.")

0 comments on commit d15ae46

Please sign in to comment.