Skip to content

Commit 2f54b36

Browse files
Reduce friction in adding new endpoints to the stub.
1 parent 96434d3 commit 2f54b36

1 file changed

Lines changed: 2 additions & 12 deletions

File tree

gateway-api/tests/contract/stub/test_sds_stub_contract.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -238,22 +238,12 @@ def test_endpoint_bundle_matches_expected_response(
238238
assert body["type"] == "searchset"
239239
assert body["total"] == len(body["entry"])
240240

241-
assert len(body["entry"]) == 4
242-
endpoint_ids = [
243-
"E0E0E921-92CA-4A88-A550-2DBB36F703AF",
244-
"E1E1E921-92CA-4A88-A550-2DBB36F703AF",
245-
"E2E2E921-92CA-4A88-A550-2DBB36F703AF",
246-
"E3E3E921-92CA-4A88-A550-2DBB36F703AF",
247-
]
248-
for i in range(len(endpoint_ids)):
249-
entry = body["entry"][i]
250-
251-
endpoint_id = endpoint_ids[i]
241+
for entry in body["entry"]:
242+
endpoint_id = entry["resource"]["id"]
252243
assert (
253244
entry["fullUrl"]
254245
== f"https://sandbox.api.service.nhs.uk/spine-directory/FHIR/R4/Endpoint/{endpoint_id}"
255246
)
256-
assert entry["resource"]["id"] == endpoint_id
257247
assert entry["search"]["mode"] == "match"
258248

259249
def test_x_correlation_id_echoed_back_when_provided(

0 commit comments

Comments
 (0)