diff --git a/tests/live_stream_tracker_test.py b/tests/live_stream_tracker_test.py index 3d3fba5..4d38568 100644 --- a/tests/live_stream_tracker_test.py +++ b/tests/live_stream_tracker_test.py @@ -61,7 +61,9 @@ def test_generate_detections( mock_results[0].boxes = mock_boxes mock_yolo_instance.track.return_value = mock_results - mock_now = datetime.datetime(2023, 1, 1, 0, 0, 0, tzinfo=datetime.timezone.utc) + mock_now = datetime.datetime( + 2023, 1, 1, 0, 0, 0, tzinfo=datetime.timezone.utc, + ) mock_datetime.datetime.now.side_effect = [mock_now, mock_now] frame_generator = self.detector.generate_detections() @@ -98,10 +100,14 @@ def test_run_detection(self, mock_generate_detections): with patch('builtins.print') as mock_print: self.detector.run_detection() - expected_datetime = datetime.datetime.fromtimestamp(1234567890.0, tz=datetime.timezone.utc).strftime('%Y-%m-%d %H:%M:%S') + expected_datetime = datetime.datetime.fromtimestamp( + 1234567890.0, tz=datetime.timezone.utc, + ).strftime('%Y-%m-%d %H:%M:%S') self.assertTrue( any( - 'Timestamp:' in str(call) and expected_datetime in str(call) + 'Timestamp:' in str( + call, + ) and expected_datetime in str(call) for call in mock_print.call_args_list ), ) diff --git a/tests/monitor_logger_test.py b/tests/monitor_logger_test.py index 89f0d0a..885f460 100644 --- a/tests/monitor_logger_test.py +++ b/tests/monitor_logger_test.py @@ -115,7 +115,9 @@ def test_logger_output( # Test logging output with self.assertLogs(logger, level='INFO') as log: logger.info('Test log message') - expected_message = 'INFO:SiteSafetyMonitor_test.log:Test log message'.upper() + expected_message = ( + 'INFO:SiteSafetyMonitor_test.log:Test log message'.upper() + ) log_messages = [msg.upper() for msg in log.output] self.assertIn(expected_message, log_messages)