Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 25 additions & 7 deletions gateway-api/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions gateway-api/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ clinical-data-common = { git = "https://github.com/NHSDigital/clinical-data-comm
flask = "^3.1.2"
types-flask = "^1.1.6"
requests = "^2.32.5"
pytest-mock = "^3.15.1"

[tool.poetry]
packages = [{include = "gateway_api", from = "src"},
Expand Down Expand Up @@ -55,6 +56,7 @@ dev = [
"schemathesis>=4.4.1",
"types-requests (>=2.32.4.20250913,<3.0.0.0)",
"types-pyyaml (>=6.0.12.20250915,<7.0.0.0)",
"pytest-mock (>=3.15.1,<4.0.0)",
]

[tool.mypy]
Expand Down
36 changes: 36 additions & 0 deletions gateway-api/src/gateway_api/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
"""Pytest configuration and shared fixtures for gateway API tests."""

from datetime import datetime, timezone

import pytest
from fhir.bundle import Bundle
from fhir.parameters import Parameters


Expand All @@ -18,3 +21,36 @@ def valid_simple_request_payload() -> Parameters:
},
],
}


@pytest.fixture
def valid_simple_response_payload() -> Bundle:
return {
"resourceType": "Bundle",
"id": "example-patient-bundle",
"type": "collection",
"timestamp": datetime.now(timezone.utc).isoformat(),
"entry": [
{
"fullUrl": "https://example.com/Patient/9999999999",
"resource": {
"name": [{"family": "Alice", "given": ["Johnson"], "use": "Ally"}],
"gender": "female",
"birthDate": "1990-05-15",
"resourceType": "Patient",
"id": "9999999999",
"identifier": [
{"value": "9999999999", "system": "urn:nhs:numbers"}
],
},
}
],
}


@pytest.fixture
def valid_headers() -> dict[str, str]:
return {
"Ssp-TraceID": "test-trace-id",
"ODS-from": "test-ods",
}
Loading