Skip to content

Commit

Permalink
Debug
Browse files Browse the repository at this point in the history
  • Loading branch information
yihong1120 committed Oct 22, 2024
1 parent 61ae048 commit b367c4a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/notifiers/line_notifier_message_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import json
import os
import logging
from datetime import datetime
from datetime import timedelta
from typing import TypedDict
Expand Down Expand Up @@ -78,7 +79,7 @@ def load_image_records(self) -> dict:
with open(self.image_record_file) as file:
return json.load(file)
except Exception as e:
print(f"Failed to load image records: {e}")
logging.error(f"Failed to load image records: {e}")
return {}

def save_image_records(self) -> None:
Expand Down
4 changes: 2 additions & 2 deletions tests/src/notifiers/line_notifier_message_api_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,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.
"""
Expand Down

0 comments on commit b367c4a

Please sign in to comment.