@@ -272,6 +272,7 @@ def test_lambda_handler_extended_attributes_success(self, mock_get_redis_client)
272272
273273 # Patch uuid4 (message id), and prevent external copy issues by simulating move
274274 with (
275+ patch ("file_name_processor.validate_permissions_for_extended_attributes_files" , return_value = "X8E5B_COVID" ),
275276 patch ("file_name_processor.uuid4" , return_value = test_cases [0 ].message_id ),
276277 patch (
277278 "file_name_processor.copy_file_to_external_bucket" ,
@@ -348,6 +349,7 @@ def test_lambda_handler_extended_attributes_failure(self, mock_get_redis_client)
348349
349350 # Patch uuid4 (message id), and raise an exception instead of moving the file.
350351 with (
352+ patch ("file_name_processor.validate_permissions_for_extended_attributes_files" , return_value = "X8E5B_COVID" ),
351353 patch ("file_name_processor.uuid4" , return_value = test_cases [0 ].message_id ),
352354 patch ("file_name_processor.copy_file_to_external_bucket" , side_effect = Exception ("Test ClientError" )),
353355 patch (
@@ -472,6 +474,7 @@ def test_lambda_handler_extended_attributes_extension_checks(self, mock_get_redi
472474 csv_key = MockFileDetails .extended_attributes_file .file_key
473475 s3_client .put_object (Bucket = BucketNames .SOURCE , Key = csv_key , Body = MOCK_EXTENDED_ATTRIBUTES_FILE_CONTENT )
474476 with (
477+ patch ("file_name_processor.validate_permissions_for_extended_attributes_files" , return_value = "X8E5B_COVID" ),
475478 patch ("file_name_processor.uuid4" , return_value = "EA_csv_id" ),
476479 patch (
477480 "file_name_processor.copy_file_to_external_bucket" ,
@@ -500,9 +503,10 @@ def test_lambda_handler_extended_attributes_extension_checks(self, mock_get_redi
500503 s3_client .get_object (Bucket = BucketNames .DESTINATION , Key = f"dps_destination/{ csv_key } " )
501504
502505 # .DAT accepted
503- dat_key = csv_key [:- 3 ] + "dat"
506+ dat_key = MockFileDetails . extended_attributes_file . file_key [:- 3 ] + "dat"
504507 s3_client .put_object (Bucket = BucketNames .SOURCE , Key = dat_key , Body = MOCK_EXTENDED_ATTRIBUTES_FILE_CONTENT )
505508 with (
509+ patch ("file_name_processor.validate_permissions_for_extended_attributes_files" , return_value = "X8E5B_COVID" ),
506510 patch ("file_name_processor.uuid4" , return_value = "EA_dat_id" ),
507511 patch (
508512 "file_name_processor.copy_file_to_external_bucket" ,
0 commit comments