From ef139707f3fd9058e8c2e6b824f01be3b0f25537 Mon Sep 17 00:00:00 2001 From: Oleg A Date: Wed, 21 Sep 2022 07:32:30 +0300 Subject: [PATCH] test: add initial sleep test --- tests/test_utils/test_chat_action.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/test_utils/test_chat_action.py b/tests/test_utils/test_chat_action.py index caf05e33..4ac4f3c1 100644 --- a/tests/test_utils/test_chat_action.py +++ b/tests/test_utils/test_chat_action.py @@ -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", [