Skip to content

Commit 4fc1757

Browse files
committed
fix(misc): increased number of attempts for ratelimited session because of github action speed (#37)
1 parent 94f144b commit 4fc1757

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

tests/test_ratelimitedsession.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,19 @@
2323
class TestsRateLimitedSession(TestsChurchToolsApiAbstract):
2424
"""Test for Rate limits."""
2525

26-
def test_no_rate_limit(self, caplog: pytest.LogCaptureFixture) -> None:
27-
"""Reference time for 250 requests without throttle using google.com."""
28-
SAMPLE_SONG_ID = 408
26+
def test_rate_limit_logged(self, caplog: pytest.LogCaptureFixture) -> None:
27+
"""This test tries to send many request in order to log a "rate limit message.
2928
29+
it will only work if your client sends these requests fast enough.
30+
31+
Args:
32+
caplog: _description_
33+
"""
3034
with caplog.at_level(logging.INFO, logger="ratelimitedsession"):
31-
for _i in range(750):
32-
self.api.get_songs(song_id=SAMPLE_SONG_ID)
35+
for _i in range(1500):
36+
self.api.get_calendars()
3337
EXPECTED_MESSAGES = [
3438
"rate limit reached - waiting 15 sec before repeating request"
3539
]
3640

37-
assert caplog.messages == EXPECTED_MESSAGES
41+
assert all(message in EXPECTED_MESSAGES for message in caplog.messages)

0 commit comments

Comments
 (0)