Skip to content

Commit 06f9847

Browse files
removed some breaking code
1 parent 16bb879 commit 06f9847

2 files changed

Lines changed: 2 additions & 24 deletions

File tree

tests/e2e/tests/conftest.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -46,25 +46,3 @@ def _setup(scenario, config_path):
4646
return nhs_number, config_filenames, request_headers, query_params, expected_response_code
4747

4848
return _setup
49-
50-
@pytest.fixture(scope="session")
51-
def validate_against_spec():
52-
"""
53-
Validates an API response against the Eligibility Signposting API spec.
54-
Loads the spec once per test session.
55-
"""
56-
parser = ResolvingParser(SPEC_PATH)
57-
openapi_spec = parser.specification
58-
59-
def _validate(status_code, response_body):
60-
try:
61-
method_spec = openapi_spec["paths"][API_PATH][API_METHOD]
62-
response_schema = method_spec["responses"][str(status_code)]["content"]["application/json"]["schema"]
63-
64-
validate(instance=response_body, schema=response_schema)
65-
except KeyError as e:
66-
pytest.fail(f"Spec does not define schema for GET {API_PATH} {status_code}: {e}")
67-
except Exception as e:
68-
pytest.fail(f"Schema validation failed: {e}")
69-
70-
return _validate

tests/e2e/tests/test_story_tests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
@pytest.mark.functionale2eregression
1818
@pytest.mark.parametrize(("filename", "scenario"), param_list, ids=id_list)
19-
def test_run_story_test_cases(filename, scenario, eligibility_client, get_scenario_params, validate_against_spec):
19+
def test_run_story_test_cases(filename, scenario, eligibility_client, get_scenario_params):
2020
nhs_number, config_filenames, request_headers, query_params, expected_response_code = get_scenario_params(scenario, config_path)
2121

2222
actual_response = eligibility_client.make_request(
@@ -25,7 +25,7 @@ def test_run_story_test_cases(filename, scenario, eligibility_client, get_scenar
2525
expected_response = all_expected_responses.get(filename).get("response_items", {})
2626
expected_response_code = expected_response_code or http.HTTPStatus.OK
2727

28-
assert actual_response["status_code"] == http.HTTPStatus.OK
28+
assert actual_response["status_code"] == expected_response_code
2929
assert actual_response["body"] == expected_response, (
3030
f"\n❌ Mismatch in test: {filename}\n"
3131
f"NHS Number: {nhs_number}\n"

0 commit comments

Comments
 (0)