From 7a7cf0dbda278d0e06cb035b3539ca8d190241c0 Mon Sep 17 00:00:00 2001 From: yihong1120 Date: Tue, 22 Oct 2024 23:25:11 +0800 Subject: [PATCH] Debug --- src/notifiers/line_notifier_message_api.py | 2 +- tests/src/notifiers/line_notifier_message_api_test.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/notifiers/line_notifier_message_api.py b/src/notifiers/line_notifier_message_api.py index 2cacb14..5331bf0 100644 --- a/src/notifiers/line_notifier_message_api.py +++ b/src/notifiers/line_notifier_message_api.py @@ -1,8 +1,8 @@ from __future__ import annotations import json -import os import logging +import os from datetime import datetime from datetime import timedelta from typing import TypedDict diff --git a/tests/src/notifiers/line_notifier_message_api_test.py b/tests/src/notifiers/line_notifier_message_api_test.py index 9b4753e..9f3fb2b 100644 --- a/tests/src/notifiers/line_notifier_message_api_test.py +++ b/tests/src/notifiers/line_notifier_message_api_test.py @@ -1,5 +1,6 @@ from __future__ import annotations +import logging import os import unittest from datetime import datetime @@ -24,6 +25,8 @@ def setUp(self): """ Set up mock data and environment for each test case. """ + logging.basicConfig(level=logging.ERROR) + self.channel_access_token = 'test_channel_access_token' self.messenger = LineMessenger( channel_access_token=self.channel_access_token, @@ -418,8 +421,8 @@ def test_main( def test_load_image_records_failure( self, mock_logging_error: MagicMock, - mock_file: MagicMock - ) -> None: + mock_file: MagicMock, + ) -> None: """ Test failure when loading image records from JSON file. """