From 35aa61c651217663406c9cd6df404f85338b2d68 Mon Sep 17 00:00:00 2001 From: TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> Date: Thu, 2 Apr 2026 14:17:43 +0900 Subject: style: fix lint and formatting issues across news collector and shared --- services/news-collector/tests/test_truth_social.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'services/news-collector/tests/test_truth_social.py') diff --git a/services/news-collector/tests/test_truth_social.py b/services/news-collector/tests/test_truth_social.py index bcf8a8c..91ddb9d 100644 --- a/services/news-collector/tests/test_truth_social.py +++ b/services/news-collector/tests/test_truth_social.py @@ -1,22 +1,32 @@ """Tests for Truth Social collector.""" + import pytest from unittest.mock import AsyncMock, patch from news_collector.collectors.truth_social import TruthSocialCollector + @pytest.fixture def collector(): return TruthSocialCollector() + def test_collector_name(collector): assert collector.name == "truth_social" assert collector.poll_interval == 900 + async def test_is_available(collector): assert await collector.is_available() is True + async def test_collect_parses_posts(collector): mock_posts = [ - {"content": "
We are imposing 25% tariffs on all steel imports!
", "created_at": "2026-04-02T12:00:00.000Z", "url": "https://truthsocial.com/@realDonaldTrump/12345", "id": "12345"}, + { + "content": "We are imposing 25% tariffs on all steel imports!
", + "created_at": "2026-04-02T12:00:00.000Z", + "url": "https://truthsocial.com/@realDonaldTrump/12345", + "id": "12345", + }, ] with patch.object(collector, "_fetch_posts", new_callable=AsyncMock, return_value=mock_posts): items = await collector.collect() @@ -24,6 +34,7 @@ async def test_collect_parses_posts(collector): assert items[0].source == "truth_social" assert items[0].category.value == "policy" + async def test_collect_handles_empty(collector): with patch.object(collector, "_fetch_posts", new_callable=AsyncMock, return_value=[]): items = await collector.collect() -- cgit v1.2.3