From 3a018eb4f9f5a7ec615651ed92d8b73c941d28d9 Mon Sep 17 00:00:00 2001 From: Mohammad Amin Date: Thu, 5 Dec 2024 14:28:36 +0330 Subject: [PATCH] fix: test case to align with the latest codes! --- .../integration/test_discord_fetch_raw_messages.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/dags/hivemind_etl_helpers/tests/integration/test_discord_fetch_raw_messages.py b/dags/hivemind_etl_helpers/tests/integration/test_discord_fetch_raw_messages.py index 66dfc77c..6ae30624 100644 --- a/dags/hivemind_etl_helpers/tests/integration/test_discord_fetch_raw_messages.py +++ b/dags/hivemind_etl_helpers/tests/integration/test_discord_fetch_raw_messages.py @@ -367,14 +367,17 @@ def test_fetch_raw_messages_fetch_limited_characters(self): client[guild_id]["rawinfos"].insert_many(raw_data) - # Fetch messages from a specific date (October 3, 2023) - messages = fetch_raw_messages(guild_id, selected_channels=channels) + messages = fetch_raw_messages( + guild_id, + selected_channels=channels, + from_date=datetime(2023, 9, 20), + ) # Check if the fetched messages are equal to the expected messages self.assertCountEqual(messages, 1) - def test_fetch_raw_messages_fetch_limited_characters(self): + def test_fetch_raw_messages_fetch_limited_characters_specified(self): """ - fetch raw messages and do filtering + fetch raw messages and do filtering with a specified value """ client = MongoSingleton.get_instance().client @@ -456,6 +459,7 @@ def test_fetch_raw_messages_fetch_limited_characters(self): messages = fetch_raw_messages( guild_id, selected_channels=channels, + from_date=datetime(2023, 9, 20), min_word_limit=1, ) # Check if the fetched messages are equal to the expected messages