Skip to content

Commit 9eec5c0

Browse files
committed
Mock log exceptions
1 parent a9dc691 commit 9eec5c0

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

delta_backend/src/log_firehose.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ def __init__(
1919
self.delivery_stream_name = stream_name
2020

2121
def send_log(self, log_message):
22-
print("SW >>>>>> NOT MOCKING send_log!!!")
2322
log_to_splunk = log_message
2423
logger.info(f"Log sent to Firehose for save: {log_to_splunk}")
2524
encoded_log_data = json.dumps(log_to_splunk).encode("utf-8")

delta_backend/tests/test_convert_to_flat_json.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,16 @@ def setUp(self):
6666
],
6767
)
6868

69+
self.logger_info_patcher = patch("logging.Logger.info")
70+
self.mock_logger_info = self.logger_info_patcher.start()
71+
72+
self.logger_exception_patcher = patch("logging.Logger.exception")
73+
self.mock_logger_exception = self.logger_exception_patcher.start()
74+
75+
def tearDown(self):
76+
self.logger_exception_patcher.stop()
77+
self.logger_info_patcher.stop()
78+
6979
@staticmethod
7080
def get_event(event_name="INSERT", operation="operation", supplier="EMIS"):
7181
"""Returns test event data."""

0 commit comments

Comments
 (0)