11from pathlib import Path
22
33import pytest
4- from services .base .dynamo_service import DynamoDBService
54from syrupy .filters import paths
5+
6+ from services .base .dynamo_service import DynamoDBService
67from tests .e2e .bulk_upload .conftest import (
78 get_all_entries_from_table_by_nhs_number ,
9+ get_entry_from_table_by_custodian ,
810 get_entry_from_table_by_nhs_number ,
9- read_metadata_csv , get_entry_from_table_by_custodian ,
11+ read_metadata_csv ,
1012)
1113from tests .e2e .helpers .data_helper import LloydGeorgeDataHelper
1214
2022accept_test_cases = []
2123for record in accept_test_data :
2224 accept_test_cases .append (
23- (record ["Test-Description" ], record ["NHS-NO" ], record ["GP-PRACTICE-CODE" ])
25+ (record ["Test-Description" ], record ["NHS-NO" ], record ["GP-PRACTICE-CODE" ]),
2426 )
2527
2628
@@ -48,17 +50,17 @@ def test_scod_ingestions(
4850 records_by_num = {
4951 "_description" : description ,
5052 "metadata" : get_entry_from_table_by_nhs_number (
51- nhs_number , bulk_upload_table_records ["lloyd_george_records" ]
53+ nhs_number , bulk_upload_table_records ["lloyd_george_records" ],
5254 ),
5355 "bulk_upload_report" : get_entry_from_table_by_nhs_number (
54- nhs_number , bulk_upload_table_records ["bulk_upload_report_records" ]
56+ nhs_number , bulk_upload_table_records ["bulk_upload_report_records" ],
5557 ),
5658 "unstitched" : get_all_entries_from_table_by_nhs_number (
57- nhs_number , bulk_upload_table_records ["unstitched_records" ]
59+ nhs_number , bulk_upload_table_records ["unstitched_records" ],
5860 ),
5961 "review" : get_entry_from_table_by_custodian (
60- custodian , bulk_upload_table_records ["review_records" ]
61- )
62+ custodian , bulk_upload_table_records ["review_records" ],
63+ ),
6264 }
6365 assert records_by_num == snapshot_json (
6466 exclude = paths (
@@ -76,14 +78,14 @@ def test_scod_ingestions(
7678 "review.UploadDate" ,
7779 "review.Files.0.FileLocation" ,
7880 "review.Files.1.FileLocation" ,
79- )
81+ ),
8082 )
8183 metadata = records_by_num .get ("metadata" ) or {}
8284 if "Reject" not in description :
8385 metadata_s3_key = metadata .get ("S3FileKey" )
8486 s3_version_id = metadata .get ("S3VersionID" )
8587
8688 exists = lloyd_george_data_helper .check_record_exists_in_s3_with_version (
87- metadata_s3_key , s3_version_id
89+ metadata_s3_key , s3_version_id ,
8890 )
8991 assert exists
0 commit comments