From 7b87f2ada30415529a466d14fe705373bb6e8af8 Mon Sep 17 00:00:00 2001 From: Mohammad Amin Date: Tue, 6 Aug 2024 16:26:56 +0330 Subject: [PATCH] fix: missng test cases to update! + fixed black linter isssues too. --- dags/analyzer_helper/discourse/transform_raw_data.py | 6 +++--- .../tests/unit/test_discourse_transform_raw_data.py | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dags/analyzer_helper/discourse/transform_raw_data.py b/dags/analyzer_helper/discourse/transform_raw_data.py index e015c1d3..242c5a88 100644 --- a/dags/analyzer_helper/discourse/transform_raw_data.py +++ b/dags/analyzer_helper/discourse/transform_raw_data.py @@ -24,9 +24,9 @@ def create_data_entry( metadata = { **metadata, # previous ones "link": ( - f"https://{self.forum_endpoint}/t/" + - f"{int(topic_id)}/{int(post_number)}" - ) + f"https://{self.forum_endpoint}/t/" + + f"{int(topic_id)}/{int(post_number)}" + ), } result = { diff --git a/dags/analyzer_helper/tests/unit/test_discourse_transform_raw_data.py b/dags/analyzer_helper/tests/unit/test_discourse_transform_raw_data.py index 84e944fb..9536ba57 100644 --- a/dags/analyzer_helper/tests/unit/test_discourse_transform_raw_data.py +++ b/dags/analyzer_helper/tests/unit/test_discourse_transform_raw_data.py @@ -127,6 +127,7 @@ def test_transform_data_with_replied_user(self): }, { "author_id": "4444", + "text": "some content #2", "date": datetime.datetime( 2023, 9, 11, 21, 41, 43, 553000, tzinfo=datetime.timezone.utc ), @@ -135,6 +136,7 @@ def test_transform_data_with_replied_user(self): "category_id": None, "topic_id": 6134, "bot_activity": False, + "link": f"https://{self.forum_endpoint}/t/6134/1", }, "actions": [], "interactions": [ @@ -207,19 +209,20 @@ def test_transform_data_with_reactions(self): "name": "reaction", "type": "emitter", "users_engaged_id": ["6168"], - "link": f"https://{self.forum_endpoint}/t/6134/1", } ], "metadata": { "category_id": None, "topic_id": 6134, "bot_activity": False, + "link": f"https://{self.forum_endpoint}/t/6134/1", }, "source_id": "6261", }, { "actions": [], "author_id": "2", + "text": "some content #2", "date": datetime.datetime( 2023, 9, 11, 21, 42, 43, 553000, tzinfo=datetime.timezone.utc ), @@ -234,6 +237,7 @@ def test_transform_data_with_reactions(self): "category_id": None, "topic_id": 6134, "bot_activity": False, + "link": f"https://{self.forum_endpoint}/t/6134/1", }, "source_id": "6261", },