@@ -384,7 +384,7 @@ def test_duplicates_csv_to_sqs_metadata(mocker, bulk_upload_service):
384384 expected = copy .deepcopy (EXPECTED_PARSED_METADATA_2 )
385385 for metadata in expected :
386386 for file in metadata .files :
387- file .stored_file_name = (
387+ file .file_path = (
388388 f"test_practice_directory/{ file .stored_file_name .lstrip ('/' )} "
389389 )
390390
@@ -473,11 +473,11 @@ def test_process_metadata_row_success(mocker, test_service):
473473
474474 expected_sqs_metadata = BulkUploadQueueMetadata .model_validate (
475475 {
476- "file_path" : "some/path/file.pdf" ,
476+ "file_path" : "test_practice_directory/ some/path/file.pdf" ,
477477 "nhs_number" : "1234567890" ,
478478 "gp_practice_code" : "Y12345" ,
479479 "scan_date" : "01/01/2023" ,
480- "stored_file_name" : "test_practice_directory/ corrected.pdf" ,
480+ "stored_file_name" : "corrected.pdf" ,
481481 }
482482 )
483483
@@ -488,7 +488,7 @@ def test_process_metadata_row_adds_to_existing_entry(mocker):
488488 key = ("1234567890" , "Y12345" )
489489 mock_metadata_existing = BulkUploadQueueMetadata .model_validate (
490490 {
491- "file_path" : "/some/path/file1.pdf" ,
491+ "file_path" : "test_practice_directory /some/path/file1.pdf" ,
492492 "nhs_number" : "1234567890" ,
493493 "gp_practice_code" : "Y12345" ,
494494 "scan_date" : "01/01/2023" ,
@@ -530,8 +530,8 @@ def test_process_metadata_row_adds_to_existing_entry(mocker):
530530 assert len (patients [key ]) == 2
531531 assert patients [key ][0 ] == mock_metadata_existing
532532 assert isinstance (patients [key ][1 ], BulkUploadQueueMetadata )
533- assert patients [key ][1 ].file_path == "/some/path/file2.pdf"
534- assert patients [key ][1 ].stored_file_name == "test_practice_directory /some/path/file2.pdf"
533+ assert patients [key ][1 ].file_path == "test_practice_directory /some/path/file2.pdf"
534+ assert patients [key ][1 ].stored_file_name == "/some/path/file2.pdf"
535535
536536
537537def test_extract_patient_info (test_service , base_metadata_file ):
@@ -875,10 +875,10 @@ def test_remapping_mandatory_fields(
875875 nhs_number = "123456789" ,
876876 files = [
877877 BulkUploadQueueMetadata (
878- file_path = "/path/1.pdf" ,
878+ file_path = "test_practice_directory /path/1.pdf" ,
879879 gp_practice_code = "Y12345" ,
880880 scan_date = "02/01/2023" ,
881- stored_file_name = "test_practice_directory /path/1.pdf" ,
881+ stored_file_name = "/path/1.pdf" ,
882882 )
883883 ],
884884 retries = 0 ,
@@ -945,10 +945,10 @@ def test_no_remapping_logic(
945945 nhs_number = "123456789" ,
946946 files = [
947947 BulkUploadQueueMetadata (
948- file_path = "/path/1.pdf" ,
948+ file_path = "test_practice_directory /path/1.pdf" ,
949949 gp_practice_code = "Y12345" ,
950950 scan_date = "02/01/2023" ,
951- stored_file_name = "test_practice_directory /path/1.pdf" ,
951+ stored_file_name = "/path/1.pdf" ,
952952 )
953953 ],
954954 retries = 0 ,
0 commit comments