@@ -40,7 +40,7 @@ def tearDown(self):
4040 self .logger_exception_patcher .stop ()
4141
4242 def test_handler_success (self ):
43- with patch ("log_decorator.logging_decorator" , lambda prefix = None : (lambda f : f )):
43+ with patch ("common. log_decorator.logging_decorator" , lambda prefix = None , stream_name = None : (lambda f : f )):
4444 importlib .reload (redis_sync )
4545 mock_event = {'Records' : [self .s3_vaccine ]}
4646 self .mock_get_s3_records .return_value = [self .s3_vaccine ]
@@ -53,7 +53,7 @@ def test_handler_success(self):
5353 self .assertEqual (result ["file_keys" ], ['test-key' ])
5454
5555 def test_handler_failure (self ):
56- with patch ("log_decorator.logging_decorator" , lambda prefix = None : (lambda f : f )):
56+ with patch ("common. log_decorator.logging_decorator" , lambda prefix = None , stream_name = None : (lambda f : f )):
5757 importlib .reload (redis_sync )
5858
5959 mock_event = {'Records' : [self .s3_vaccine ]}
@@ -66,15 +66,15 @@ def test_handler_failure(self):
6666 self .assertEqual (result , {'status' : 'error' , 'message' : 'Error processing S3 event' })
6767
6868 def test_handler_no_records (self ):
69- with patch ("log_decorator.logging_decorator" , lambda prefix = None : (lambda f : f )):
69+ with patch ("common. log_decorator.logging_decorator" , lambda prefix = None , stream_name = None : (lambda f : f )):
7070 importlib .reload (redis_sync )
7171 mock_event = {'Records' : []}
7272 self .mock_get_s3_records .return_value = []
7373 result = redis_sync .handler (mock_event , None )
7474 self .assertEqual (result , {'status' : 'success' , 'message' : 'No records found in event' })
7575
7676 def test_handler_exception (self ):
77- with patch ("log_decorator.logging_decorator" , lambda prefix = None : (lambda f : f )):
77+ with patch ("common. log_decorator.logging_decorator" , lambda prefix = None , stream_name = None : (lambda f : f )):
7878 importlib .reload (redis_sync )
7979 mock_event = {'Records' : [self .s3_vaccine ]}
8080 self .mock_get_s3_records .return_value = [self .s3_vaccine ]
@@ -84,14 +84,14 @@ def test_handler_exception(self):
8484 self .assertEqual (result , {'status' : 'error' , 'message' : 'Error processing S3 event' })
8585
8686 def test_handler_with_empty_event (self ):
87- with patch ("log_decorator.logging_decorator" , lambda prefix = None : (lambda f : f )):
87+ with patch ("common. log_decorator.logging_decorator" , lambda prefix = None , stream_name = None : (lambda f : f )):
8888 importlib .reload (redis_sync )
8989 self .mock_get_s3_records .return_value = []
9090 result = redis_sync .handler ({}, None )
9191 self .assertEqual (result , {'status' : 'success' , 'message' : 'No records found in event' })
9292
9393 def test_handler_multi_record (self ):
94- with patch ("log_decorator.logging_decorator" , lambda prefix = None : (lambda f : f )):
94+ with patch ("common. log_decorator.logging_decorator" , lambda prefix = None , stream_name = None : (lambda f : f )):
9595 importlib .reload (redis_sync )
9696 mock_event = {'Records' : [self .s3_vaccine , self .s3_supplier ]}
9797 # If you need S3EventRecord, uncomment the import and use it here
@@ -112,7 +112,7 @@ def test_handler_multi_record(self):
112112 self .assertEqual (result ['file_keys' ][1 ], 'test-key2' )
113113
114114 def test_handler_read_event (self ):
115- with patch ("log_decorator.logging_decorator" , lambda prefix = None : (lambda f : f )):
115+ with patch ("common. log_decorator.logging_decorator" , lambda prefix = None , stream_name = None : (lambda f : f )):
116116 importlib .reload (redis_sync )
117117 mock_event = {'read' : 'myhash' }
118118 mock_read_event_response = {'field1' : 'value1' }
0 commit comments