11import json
2- from typing import TYPE_CHECKING , cast
2+ from typing import TYPE_CHECKING , Any , cast
33
44import pytest
5- from fhir .parameters import Parameters
65from flask import Request
76
87from gateway_api .common .common import FlaskResponse
1110from gateway_api .get_structured_record .request import GetStructuredRecordRequest
1211
1312if TYPE_CHECKING :
14- from fhir .bundle import Bundle
13+ from fhir .bundle import BundleTypedDict
1514
1615
1716@pytest .fixture
18- def mock_request_with_headers (valid_simple_request_payload : Parameters ) -> Request :
17+ def mock_request_with_headers (valid_simple_request_payload : dict [ str , Any ] ) -> Request :
1918 headers = {
2019 "Ssp-TraceID" : "test-trace-id" ,
2120 "ODS-from" : "test-ods" ,
@@ -58,7 +57,7 @@ def test_nhs_number_is_pulled_from_request_body(
5857 assert actual == expected
5958
6059 def test_raises_value_error_when_ods_from_header_is_missing (
61- self , valid_simple_request_payload : Parameters
60+ self , valid_simple_request_payload : dict [ str , Any ]
6261 ) -> None :
6362 """Test that ValueError is raised when ODS-from header is missing."""
6463 headers = {
@@ -73,7 +72,7 @@ def test_raises_value_error_when_ods_from_header_is_missing(
7372 GetStructuredRecordRequest (request = mock_request )
7473
7574 def test_raises_value_error_when_ods_from_header_is_whitespace (
76- self , valid_simple_request_payload : Parameters
75+ self , valid_simple_request_payload : dict [ str , Any ]
7776 ) -> None :
7877 """
7978 Test that ValueError is raised when ODS-from header contains only whitespace.
@@ -91,7 +90,7 @@ def test_raises_value_error_when_ods_from_header_is_whitespace(
9190 GetStructuredRecordRequest (request = mock_request )
9291
9392 def test_raises_value_error_when_trace_id_header_is_missing (
94- self , valid_simple_request_payload : Parameters
93+ self , valid_simple_request_payload : dict [ str , Any ]
9594 ) -> None :
9695 """Test that ValueError is raised when Ssp-TraceID header is missing."""
9796 headers = {
@@ -106,7 +105,7 @@ def test_raises_value_error_when_trace_id_header_is_missing(
106105 GetStructuredRecordRequest (request = mock_request )
107106
108107 def test_raises_value_error_when_trace_id_header_is_whitespace (
109- self , valid_simple_request_payload : Parameters
108+ self , valid_simple_request_payload : dict [ str , Any ]
110109 ) -> None :
111110 """
112111 Test that ValueError is raised when Ssp-TraceID header contains only whitespace.
@@ -132,7 +131,7 @@ def test_sets_response_body_from_valid_json_data(
132131
133132 request_obj = GetStructuredRecordRequest (request = mock_request_with_headers )
134133
135- bundle_data : Bundle = {
134+ bundle_data : BundleTypedDict = {
136135 "resourceType" : "Bundle" ,
137136 "id" : "test-bundle" ,
138137 "type" : "collection" ,
0 commit comments