test: add initial sleep test

This commit is contained in:
Oleg A 2022-09-21 07:32:30 +03:00
parent 94030903ec
commit ef139707f3
No known key found for this signature in database
GPG key ID: 5FE046817A9657C5

View file

@ -27,6 +27,12 @@ class TestChatActionSender:
await sender._wait(1)
assert time.monotonic() - start < 1
async def test_initial_sleep(self, bot: Bot):
initial_sleep = 1.0
start = time.monotonic()
async with ChatActionSender.typing(bot=bot, chat_id=42, initial_sleep=initial_sleep):
assert time.monotonic() - start >= initial_sleep
@pytest.mark.parametrize(
"action",
[