From e05dffc41289789f0e05f8d33d2115d26dd7a2f4 Mon Sep 17 00:00:00 2001 From: JackPlowman <62281988+JackPlowman@users.noreply.github.com> Date: Thu, 4 Apr 2024 15:37:41 +0100 Subject: [PATCH] Add more responses for _include parameter --- sandbox/api/app.py | 21 ++- .../GET_RelatedPerson/identifier.json | 9 +- .../identifier_and_patient.json | 23 +-- .../identifier_and_patient_include.json | 138 ++++++++++++++++++ .../GET_RelatedPerson/identifier_include.json | 76 ++++++++++ sandbox/api/tests/conftest.py | 2 +- sandbox/api/tests/test_app.py | 53 +++---- sandbox/api/tests/test_utils.py | 33 +++++ sandbox/poetry.lock | 87 ++++++++++- sandbox/pyproject.toml | 1 + 10 files changed, 403 insertions(+), 40 deletions(-) create mode 100644 sandbox/api/responses/GET_RelatedPerson/identifier_and_patient_include.json create mode 100644 sandbox/api/responses/GET_RelatedPerson/identifier_include.json diff --git a/sandbox/api/app.py b/sandbox/api/app.py index 60adab5..744c3cf 100644 --- a/sandbox/api/app.py +++ b/sandbox/api/app.py @@ -33,12 +33,31 @@ def get_related_persons() -> Union[dict, tuple]: # Check Headers if errors := check_for_errors(request): return errors + # Successful request, select response - if request.args.get("identifier") and request.args.get("patient"): + if ( + request.args.get("identifier") + and request.args.get("patient") + and request.args.get("_include") == "patient" + ): + # Request with identifier, patient and _include=patient + return get_response( + "./api/responses/GET_RelatedPerson/identifier_and_patient_include.json" + ) + elif request.args.get("identifier") and request.args.get("patient"): + # Request with identifier and patient return get_response( "./api/responses/GET_RelatedPerson/identifier_and_patient.json" ) + elif ( + request.args.get("identifier") and request.args.get("_include") == "patient" + ): + # Request with identifier and _include=patient + return get_response( + "./api/responses/GET_RelatedPerson/identifier_include.json" + ) elif request.args.get("identifier"): + # Request with identifier return get_response("./api/responses/GET_RelatedPerson/identifier.json") else: raise ValueError("Invalid request") diff --git a/sandbox/api/responses/GET_RelatedPerson/identifier.json b/sandbox/api/responses/GET_RelatedPerson/identifier.json index 6380cd5..a0d5d98 100644 --- a/sandbox/api/responses/GET_RelatedPerson/identifier.json +++ b/sandbox/api/responses/GET_RelatedPerson/identifier.json @@ -1,7 +1,7 @@ { "entry": [ { - "fullUrl": "/validated-relationships/FHIR/R4/RelatedPerson/ABCD1234", + "fullUrl": "https://internal-dev.api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/ABCD1234", "resource": { "id": "ABCD1234", "identifier": [ @@ -38,7 +38,12 @@ "search": { "mode": "match" } } ], - "link": [{ "relation": "self", "url": "sandbox" }], + "link": [ + { + "relation": "self", + "url": "sandbox" + } + ], "timestamp": "2024-00-00T00:00:00+00:00", "total": 1, "type": "searchset", diff --git a/sandbox/api/responses/GET_RelatedPerson/identifier_and_patient.json b/sandbox/api/responses/GET_RelatedPerson/identifier_and_patient.json index b54b5d8..2419477 100644 --- a/sandbox/api/responses/GET_RelatedPerson/identifier_and_patient.json +++ b/sandbox/api/responses/GET_RelatedPerson/identifier_and_patient.json @@ -1,19 +1,19 @@ { "entry": [ { - "fullUrl": "/validated-relationships/FHIR/R4/RelatedPerson/ABCD1234", + "fullUrl": "https://internal-dev.api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742", "resource": { - "id": "ABCD1234", + "id": "BE974742", "identifier": [ { "system": "https://fhir.nhs.uk/Id/nhs-number", - "value": "1234567890" + "value": "4567891012" } ], "patient": { "identifier": { "system": "https://fhir.nhs.uk/Id/nhs-number", - "value": "0987654321" + "value": "3456789101" }, "type": "Patient" }, @@ -38,19 +38,19 @@ "search": { "mode": "match" } }, { - "fullUrl": "/validated-relationships/FHIR/R4/RelatedPerson/1234ABCD", + "fullUrl": "https://internal-dev.api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/A3CC67E2", "resource": { - "id": "1234ABCD", + "id": "A3CC67E2", "identifier": [ { "system": "https://fhir.nhs.uk/Id/nhs-number", - "value": "1234567890" + "value": "4567891012" } ], "patient": { "identifier": { "system": "https://fhir.nhs.uk/Id/nhs-number", - "value": "2234567890" + "value": "5678910123" }, "type": "Patient" }, @@ -75,7 +75,12 @@ "search": { "mode": "match" } } ], - "link": [{ "relation": "self", "url": "" }], + "link": [ + { + "relation": "self", + "url": "sandbox" + } + ], "timestamp": "2024-00-00T00:00:00+00:00", "total": 2, "type": "searchset", diff --git a/sandbox/api/responses/GET_RelatedPerson/identifier_and_patient_include.json b/sandbox/api/responses/GET_RelatedPerson/identifier_and_patient_include.json new file mode 100644 index 0000000..dbe6774 --- /dev/null +++ b/sandbox/api/responses/GET_RelatedPerson/identifier_and_patient_include.json @@ -0,0 +1,138 @@ +{ + "entry": [ + { + "fullUrl": "https://internal-dev.api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/3456789101", + "resource": { + "id": "3456789101", + "birthDate": "2017-09-23", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "3456789101" + } + ], + "name": [ + { + "id": "BLnbA", + "family": "MOGAJI", + "given": ["GADIL"], + "period": { "start": "2021-07-08" }, + "prefix": ["MR"], + "use": "usual" + } + ], + "resourceType": "Patient" + }, + "search": { "mode": "include" } + }, + { + "fullUrl": "https://internal-dev.api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742", + "resource": { + "id": "BE974742", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "4567891012" + } + ], + "patient": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "3456789101" + }, + "type": "Patient" + }, + "relationship": [ + { + "coding": [ + { + "code": "MTH", + "display": "mother", + "system": "http://hl7.org/fhir/ValueSet/relatedperson-relationshiptype" + }, + { + "code": "Personal", + "display": "Personal relationship with the patient", + "system": "https://fhir.nhs.uk/R4/CodeSystem/UKCore-AdditionalRelatedPersonRole" + } + ] + } + ], + "resourceType": "RelatedPerson" + }, + "search": { "mode": "match" } + }, + { + "fullUrl": "https://internal-dev.api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/5678910123", + "resource": { + "id": "5678910123", + "birthDate": "2018-04-27", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "5678910123" + } + ], + "name": [ + { + "id": "vitjN", + "family": "FEARON", + "given": ["Daren"], + "period": { "start": "2018-09-21" }, + "prefix": ["MR"], + "use": "usual" + } + ], + "resourceType": "Patient" + }, + "search": { "mode": "include" } + }, + { + "fullUrl": "https://internal-dev.api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/A3CC67E2", + "resource": { + "id": "A3CC67E2", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "4567891012" + } + ], + "patient": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "5678910123" + }, + "type": "Patient" + }, + "relationship": [ + { + "coding": [ + { + "code": "MTH", + "display": "mother", + "system": "http://hl7.org/fhir/ValueSet/relatedperson-relationshiptype" + }, + { + "code": "Personal", + "display": "Personal relationship with the patient", + "system": "https://fhir.nhs.uk/R4/CodeSystem/UKCore-AdditionalRelatedPersonRole" + } + ] + } + ], + "resourceType": "RelatedPerson" + }, + "search": { "mode": "match" } + } + ], + "link": [ + { + "relation": "self", + "url": "sandbox" + } + ], + "timestamp": "2024-00-00T00:00:00+00:00", + "total": 4, + "type": "searchset", + "resourceType": "Bundle" +} diff --git a/sandbox/api/responses/GET_RelatedPerson/identifier_include.json b/sandbox/api/responses/GET_RelatedPerson/identifier_include.json new file mode 100644 index 0000000..5274cc6 --- /dev/null +++ b/sandbox/api/responses/GET_RelatedPerson/identifier_include.json @@ -0,0 +1,76 @@ +{ + "entry": [ + { + "fullUrl": "https://internal-dev.api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/0987654321", + "resource": { + "id": "0987654321", + "birthDate": "2014-09-21", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "0987654321" + } + ], + "name": [ + { + "id": "ggvay", + "family": "WOMACK", + "given": ["David", "Gus"], + "period": { "start": "2018-06-24" }, + "prefix": ["MR"], + "use": "usual" + } + ], + "resourceType": "Patient" + }, + "search": { "mode": "include" } + }, + { + "fullUrl": "https://internal-dev.api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/ABCD1234", + "resource": { + "id": "ABCD1234", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "1234567890" + } + ], + "patient": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "0987654321" + }, + "type": "Patient" + }, + "relationship": [ + { + "coding": [ + { + "code": "MTH", + "display": "mother", + "system": "http://hl7.org/fhir/ValueSet/relatedperson-relationshiptype" + }, + { + "code": "Personal", + "display": "Personal relationship with the patient", + "system": "https://fhir.nhs.uk/R4/CodeSystem/UKCore-AdditionalRelatedPersonRole" + } + ] + } + ], + "resourceType": "RelatedPerson" + }, + "search": { "mode": "match" } + } + ], + "link": [ + { + "relation": "self", + "url": "sandbox" + } + ], + "timestamp": "2024-00-00T00:00:00+00:00", + "total": 2, + "type": "searchset", + "resourceType": "Bundle" +} diff --git a/sandbox/api/tests/conftest.py b/sandbox/api/tests/conftest.py index 57798b8..be23de5 100644 --- a/sandbox/api/tests/conftest.py +++ b/sandbox/api/tests/conftest.py @@ -1,7 +1,7 @@ import pytest from ..app import app - +RELATED_PERSON_API_ENDPOINT = "/FHIR/R4/RelatedPerson" @pytest.fixture() def client() -> object: diff --git a/sandbox/api/tests/test_app.py b/sandbox/api/tests/test_app.py index a89abdc..300cb06 100644 --- a/sandbox/api/tests/test_app.py +++ b/sandbox/api/tests/test_app.py @@ -2,8 +2,9 @@ import pytest +from .conftest import RELATED_PERSON_API_ENDPOINT + FILE_PATH = "sandbox.api.app" -RELATED_PERSON_API_ENDPOINT = "/FHIR/R4/RelatedPerson" @pytest.mark.parametrize("endpoint", ["/_status", "/_ping", "/health"]) @@ -19,37 +20,37 @@ def test_health_check(client: object, endpoint: str) -> None: } +@pytest.mark.parametrize( + "request_args,response_file_name", + [ + ("identifier=1234567890", "./api/responses/GET_RelatedPerson/identifier.json"), + ( + "identifier=1234567890&patient=0987654321", + "./api/responses/GET_RelatedPerson/identifier_and_patient.json", + ), + ( + "identifier=1234567890&_include=patient", + "./api/responses/GET_RelatedPerson/identifier_include.json", + ), + ( + "identifier=1234567890&patient=0987654321&_include=patient", + "./api/responses/GET_RelatedPerson/identifier_and_patient_include.json", + ), + ], +) @patch(f"{FILE_PATH}.get_response") -def test_related_person__identifier_only( - mock_get_response: MagicMock, client: object +def test_related_person( + mock_get_response: MagicMock, + request_args: str, + response_file_name: str, + client: object, ) -> None: """Test related_persons endpoint with identifier only.""" # Arrange mock_get_response.return_value = expected_body = {"data": "mocked"} # Act - response = client.get(f"{RELATED_PERSON_API_ENDPOINT}?identifier=1234567890") - # Assert - mock_get_response.assert_called_once_with( - "./api/responses/GET_RelatedPerson/identifier.json" - ) - assert response.status_code == 200 - assert response.json == expected_body - - -@patch(f"{FILE_PATH}.get_response") -def test_related_person__identifier_and_patient( - mock_get_response: MagicMock, client: object -) -> None: - """Test related_persons endpoint with identifier and patient.""" - # Arrange - mock_get_response.return_value = expected_body = {"data": "mocked"} - # Act - response = client.get( - f"{RELATED_PERSON_API_ENDPOINT}?identifier=1234567890&patient=0987654321" - ) + response = client.get(f"{RELATED_PERSON_API_ENDPOINT}?{request_args}") # Assert - mock_get_response.assert_called_once_with( - "./api/responses/GET_RelatedPerson/identifier_and_patient.json" - ) + mock_get_response.assert_called_once_with(response_file_name) assert response.status_code == 200 assert response.json == expected_body diff --git a/sandbox/api/tests/test_utils.py b/sandbox/api/tests/test_utils.py index f8b7a97..2c0d14d 100644 --- a/sandbox/api/tests/test_utils.py +++ b/sandbox/api/tests/test_utils.py @@ -1,6 +1,9 @@ from unittest.mock import MagicMock, patch +import pytest + from ..utils import get_response +from .conftest import RELATED_PERSON_API_ENDPOINT FILE_PATH = "sandbox.api.utils" @@ -17,3 +20,33 @@ def test_get_response(mock_open: MagicMock) -> None: # Assert mock_open.assert_called_once_with(file_name, "r") assert response == {"data": "mocked"} + + +@pytest.mark.parametrize( + "request_args,response_file_name,status_code", + [ + ( + "", # identifier is missing + "./api/responses/GET_RelatedPerson/bad_request_identifier_missing.json", + 400, + ), + ( + "identifier=123456789", # identifier length is less than 10 + "./api/responses/GET_RelatedPerson/bad_request_identifier_not_as_expected.json", + 400, + ), + ], +) +@patch(f"{FILE_PATH}.get_response") +def test_check_for_errors( + mock_get_response: MagicMock, + request_args: str, + response_file_name: str, + status_code: int, + client: object, +) -> None: + # Act + response = client.get(f"{RELATED_PERSON_API_ENDPOINT}?{request_args}") + # Assert + mock_get_response.assert_called_once_with(response_file_name) + assert response.status_code == status_code diff --git a/sandbox/poetry.lock b/sandbox/poetry.lock index 8d14f6c..b04c7d0 100644 --- a/sandbox/poetry.lock +++ b/sandbox/poetry.lock @@ -82,6 +82,73 @@ files = [ {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, ] +[[package]] +name = "coverage" +version = "7.4.4" +description = "Code coverage measurement for Python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "coverage-7.4.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e0be5efd5127542ef31f165de269f77560d6cdef525fffa446de6f7e9186cfb2"}, + {file = "coverage-7.4.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ccd341521be3d1b3daeb41960ae94a5e87abe2f46f17224ba5d6f2b8398016cf"}, + {file = "coverage-7.4.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:09fa497a8ab37784fbb20ab699c246053ac294d13fc7eb40ec007a5043ec91f8"}, + {file = "coverage-7.4.4-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b1a93009cb80730c9bca5d6d4665494b725b6e8e157c1cb7f2db5b4b122ea562"}, + {file = "coverage-7.4.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:690db6517f09336559dc0b5f55342df62370a48f5469fabf502db2c6d1cffcd2"}, + {file = "coverage-7.4.4-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:09c3255458533cb76ef55da8cc49ffab9e33f083739c8bd4f58e79fecfe288f7"}, + {file = "coverage-7.4.4-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:8ce1415194b4a6bd0cdcc3a1dfbf58b63f910dcb7330fe15bdff542c56949f87"}, + {file = "coverage-7.4.4-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:b91cbc4b195444e7e258ba27ac33769c41b94967919f10037e6355e998af255c"}, + {file = "coverage-7.4.4-cp310-cp310-win32.whl", hash = "sha256:598825b51b81c808cb6f078dcb972f96af96b078faa47af7dfcdf282835baa8d"}, + {file = "coverage-7.4.4-cp310-cp310-win_amd64.whl", hash = "sha256:09ef9199ed6653989ebbcaacc9b62b514bb63ea2f90256e71fea3ed74bd8ff6f"}, + {file = "coverage-7.4.4-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:0f9f50e7ef2a71e2fae92774c99170eb8304e3fdf9c8c3c7ae9bab3e7229c5cf"}, + {file = "coverage-7.4.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:623512f8ba53c422fcfb2ce68362c97945095b864cda94a92edbaf5994201083"}, + {file = "coverage-7.4.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0513b9508b93da4e1716744ef6ebc507aff016ba115ffe8ecff744d1322a7b63"}, + {file = "coverage-7.4.4-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:40209e141059b9370a2657c9b15607815359ab3ef9918f0196b6fccce8d3230f"}, + {file = "coverage-7.4.4-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8a2b2b78c78293782fd3767d53e6474582f62443d0504b1554370bde86cc8227"}, + {file = "coverage-7.4.4-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:73bfb9c09951125d06ee473bed216e2c3742f530fc5acc1383883125de76d9cd"}, + {file = "coverage-7.4.4-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:1f384c3cc76aeedce208643697fb3e8437604b512255de6d18dae3f27655a384"}, + {file = "coverage-7.4.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:54eb8d1bf7cacfbf2a3186019bcf01d11c666bd495ed18717162f7eb1e9dd00b"}, + {file = "coverage-7.4.4-cp311-cp311-win32.whl", hash = "sha256:cac99918c7bba15302a2d81f0312c08054a3359eaa1929c7e4b26ebe41e9b286"}, + {file = "coverage-7.4.4-cp311-cp311-win_amd64.whl", hash = "sha256:b14706df8b2de49869ae03a5ccbc211f4041750cd4a66f698df89d44f4bd30ec"}, + {file = "coverage-7.4.4-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:201bef2eea65e0e9c56343115ba3814e896afe6d36ffd37bab783261db430f76"}, + {file = "coverage-7.4.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:41c9c5f3de16b903b610d09650e5e27adbfa7f500302718c9ffd1c12cf9d6818"}, + {file = "coverage-7.4.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d898fe162d26929b5960e4e138651f7427048e72c853607f2b200909794ed978"}, + {file = "coverage-7.4.4-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3ea79bb50e805cd6ac058dfa3b5c8f6c040cb87fe83de10845857f5535d1db70"}, + {file = "coverage-7.4.4-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ce4b94265ca988c3f8e479e741693d143026632672e3ff924f25fab50518dd51"}, + {file = "coverage-7.4.4-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:00838a35b882694afda09f85e469c96367daa3f3f2b097d846a7216993d37f4c"}, + {file = "coverage-7.4.4-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:fdfafb32984684eb03c2d83e1e51f64f0906b11e64482df3c5db936ce3839d48"}, + {file = "coverage-7.4.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:69eb372f7e2ece89f14751fbcbe470295d73ed41ecd37ca36ed2eb47512a6ab9"}, + {file = "coverage-7.4.4-cp312-cp312-win32.whl", hash = "sha256:137eb07173141545e07403cca94ab625cc1cc6bc4c1e97b6e3846270e7e1fea0"}, + {file = "coverage-7.4.4-cp312-cp312-win_amd64.whl", hash = "sha256:d71eec7d83298f1af3326ce0ff1d0ea83c7cb98f72b577097f9083b20bdaf05e"}, + {file = "coverage-7.4.4-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:d5ae728ff3b5401cc320d792866987e7e7e880e6ebd24433b70a33b643bb0384"}, + {file = "coverage-7.4.4-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:cc4f1358cb0c78edef3ed237ef2c86056206bb8d9140e73b6b89fbcfcbdd40e1"}, + {file = "coverage-7.4.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8130a2aa2acb8788e0b56938786c33c7c98562697bf9f4c7d6e8e5e3a0501e4a"}, + {file = "coverage-7.4.4-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cf271892d13e43bc2b51e6908ec9a6a5094a4df1d8af0bfc360088ee6c684409"}, + {file = "coverage-7.4.4-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a4cdc86d54b5da0df6d3d3a2f0b710949286094c3a6700c21e9015932b81447e"}, + {file = "coverage-7.4.4-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:ae71e7ddb7a413dd60052e90528f2f65270aad4b509563af6d03d53e979feafd"}, + {file = "coverage-7.4.4-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:38dd60d7bf242c4ed5b38e094baf6401faa114fc09e9e6632374388a404f98e7"}, + {file = "coverage-7.4.4-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:aa5b1c1bfc28384f1f53b69a023d789f72b2e0ab1b3787aae16992a7ca21056c"}, + {file = "coverage-7.4.4-cp38-cp38-win32.whl", hash = "sha256:dfa8fe35a0bb90382837b238fff375de15f0dcdb9ae68ff85f7a63649c98527e"}, + {file = "coverage-7.4.4-cp38-cp38-win_amd64.whl", hash = "sha256:b2991665420a803495e0b90a79233c1433d6ed77ef282e8e152a324bbbc5e0c8"}, + {file = "coverage-7.4.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:3b799445b9f7ee8bf299cfaed6f5b226c0037b74886a4e11515e569b36fe310d"}, + {file = "coverage-7.4.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:b4d33f418f46362995f1e9d4f3a35a1b6322cb959c31d88ae56b0298e1c22357"}, + {file = "coverage-7.4.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:aadacf9a2f407a4688d700e4ebab33a7e2e408f2ca04dbf4aef17585389eff3e"}, + {file = "coverage-7.4.4-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7c95949560050d04d46b919301826525597f07b33beba6187d04fa64d47ac82e"}, + {file = "coverage-7.4.4-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ff7687ca3d7028d8a5f0ebae95a6e4827c5616b31a4ee1192bdfde697db110d4"}, + {file = "coverage-7.4.4-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:5fc1de20b2d4a061b3df27ab9b7c7111e9a710f10dc2b84d33a4ab25065994ec"}, + {file = "coverage-7.4.4-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:c74880fc64d4958159fbd537a091d2a585448a8f8508bf248d72112723974cbd"}, + {file = "coverage-7.4.4-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:742a76a12aa45b44d236815d282b03cfb1de3b4323f3e4ec933acfae08e54ade"}, + {file = "coverage-7.4.4-cp39-cp39-win32.whl", hash = "sha256:d89d7b2974cae412400e88f35d86af72208e1ede1a541954af5d944a8ba46c57"}, + {file = "coverage-7.4.4-cp39-cp39-win_amd64.whl", hash = "sha256:9ca28a302acb19b6af89e90f33ee3e1906961f94b54ea37de6737b7ca9d8827c"}, + {file = "coverage-7.4.4-pp38.pp39.pp310-none-any.whl", hash = "sha256:b2c5edc4ac10a7ef6605a966c58929ec6c1bd0917fb8c15cb3363f65aa40e677"}, + {file = "coverage-7.4.4.tar.gz", hash = "sha256:c901df83d097649e257e803be22592aedfd5182f07b3cc87d640bbb9afd50f49"}, +] + +[package.dependencies] +tomli = {version = "*", optional = true, markers = "python_full_version <= \"3.11.0a6\" and extra == \"toml\""} + +[package.extras] +toml = ["tomli"] + [[package]] name = "exceptiongroup" version = "1.2.0" @@ -400,6 +467,24 @@ tomli = {version = ">=1", markers = "python_version < \"3.11\""} [package.extras] testing = ["argcomplete", "attrs (>=19.2)", "hypothesis (>=3.56)", "mock", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] +[[package]] +name = "pytest-cov" +version = "5.0.0" +description = "Pytest plugin for measuring coverage." +optional = false +python-versions = ">=3.8" +files = [ + {file = "pytest-cov-5.0.0.tar.gz", hash = "sha256:5837b58e9f6ebd335b0f8060eecce69b662415b16dc503883a02f45dfeb14857"}, + {file = "pytest_cov-5.0.0-py3-none-any.whl", hash = "sha256:4f0764a1219df53214206bf1feea4633c3b558a2925c8b59f144f682861ce652"}, +] + +[package.dependencies] +coverage = {version = ">=5.2.1", extras = ["toml"]} +pytest = ">=4.6" + +[package.extras] +testing = ["fields", "hunter", "process-tests", "pytest-xdist", "virtualenv"] + [[package]] name = "tomli" version = "2.0.1" @@ -457,4 +542,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = "^3.8" -content-hash = "ccc19ff0631b336fa957cd46c9dd1f10cf2b6b7ddb3815a34cbd6f88c87cd852" +content-hash = "dcec0487bd759328baf6e6653ee8df9542c6db8c30e4717e0d8b282ee7d0108a" diff --git a/sandbox/pyproject.toml b/sandbox/pyproject.toml index dc71e69..c1912ef 100644 --- a/sandbox/pyproject.toml +++ b/sandbox/pyproject.toml @@ -14,3 +14,4 @@ flask = "^3.0.2" flake8 = "^3.7.9" black = "^24.3.0" pytest = "^8.1.1" +pytest-cov = "^5.0.0"