@@ -22,7 +22,8 @@ def test_search_patient_by_nhs_number_happy_path(
2222 status_code = 200 , headers = {}, _json = happy_path_pds_response_body
2323 )
2424 mocker .patch (
25- "gateway_api.pds.client._make_get_request" , return_value = happy_path_response
25+ "gateway_api.pds.client._make_session_get_request" ,
26+ return_value = happy_path_response ,
2627 )
2728
2829 client = PdsClient (base_url = "https://test.com" )
@@ -43,7 +44,8 @@ def test_search_patient_by_nhs_number_has_no_gp_returns_gp_ods_code_none(
4344 status_code = 200 , headers = {}, _json = gp_less_response_body
4445 )
4546 mocker .patch (
46- "gateway_api.pds.client._make_get_request" , return_value = gp_less_response
47+ "gateway_api.pds.client._make_session_get_request" ,
48+ return_value = gp_less_response ,
4749 )
4850
4951 client = PdsClient (base_url = "https://test.com" )
@@ -62,7 +64,8 @@ def test_search_patient_by_nhs_number_sends_expected_headers(
6264 status_code = 200 , headers = {}, _json = happy_path_pds_response_body
6365 )
6466 mocked_get = mocker .patch (
65- "gateway_api.pds.client._make_get_request" , return_value = happy_path_response
67+ "gateway_api.pds.client._make_session_get_request" ,
68+ return_value = happy_path_response ,
6669 )
6770
6871 request_id = str (uuid4 ())
@@ -93,7 +96,8 @@ def test_search_patient_by_nhs_number_generates_request_id(
9396 status_code = 200 , headers = {}, _json = happy_path_pds_response_body
9497 )
9598 mocked_get = mocker .patch (
96- "gateway_api.pds.client._make_get_request" , return_value = happy_path_response
99+ "gateway_api.pds.client._make_session_get_request" ,
100+ return_value = happy_path_response ,
97101 )
98102
99103 client = PdsClient (base_url = "https://test.com" )
@@ -116,7 +120,8 @@ def test_search_patient_by_nhs_number_not_found_raises_error(
116120 reason = "Not Found" ,
117121 )
118122 mocker .patch (
119- "gateway_api.pds.client._make_get_request" , return_value = not_found_response
123+ "gateway_api.pds.client._make_session_get_request" ,
124+ return_value = not_found_response ,
120125 )
121126 pds = PdsClient (base_url = "https://test.com" )
122127
@@ -138,7 +143,9 @@ def test_search_patient_by_nhs_number_missing_nhs_number_raises_error(
138143 headers = {},
139144 _json = response_body_missing_nhs_number ,
140145 )
141- mocker .patch ("gateway_api.pds.client._make_get_request" , return_value = response )
146+ mocker .patch (
147+ "gateway_api.pds.client._make_session_get_request" , return_value = response
148+ )
142149
143150 client = PdsClient (base_url = "https://test.com" )
144151
@@ -157,7 +164,8 @@ def test_search_patient_respects_url(
157164 status_code = 200 , headers = {}, _json = happy_path_pds_response_body
158165 )
159166 mocked_get = mocker .patch (
160- "gateway_api.pds.client._make_get_request" , return_value = happy_path_response
167+ "gateway_api.pds.client._make_session_get_request" ,
168+ return_value = happy_path_response ,
161169 )
162170
163171 client = PdsClient (base_url = "https://a.different.url/base" )
0 commit comments