From 6c23daaa89dc25f4ddc327d6babfd2083867b716 Mon Sep 17 00:00:00 2001 From: Dineshkarthik Date: Mon, 28 Feb 2022 20:52:57 +0100 Subject: [PATCH] test: add test to download skipped files logic --- tests/test_media_downloader.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/test_media_downloader.py b/tests/test_media_downloader.py index 480d466..d203ffe 100644 --- a/tests/test_media_downloader.py +++ b/tests/test_media_downloader.py @@ -29,7 +29,7 @@ MOCK_CONF = { "api_hash": "hasw5Tgawsuj67", "last_read_message_id": 0, "chat_id": 8654123, - "ids_to_retry": [], + "ids_to_retry": [1], "media_types": ["audio", "voice"], "file_formats": {"audio": ["all"], "voice": ["all"]}, } @@ -203,6 +203,18 @@ class MockClient: mime_type="video/mov", ), ) + elif kwargs["message_ids"] == [1]: + message = [ + MockMessage( + id=1, + media=True, + chat_id=234568, + video=MockVideo( + file_name="sample_video.mov", + mime_type="video/mov", + ), + ) + ] return message async def download_media(self, *args, **kwargs):