Skip to content

Commit 3302750

Browse files
[GPCAPIM-321]-[Schemathesis - currently only running the success/positive cases]-[RP] (#190)
<!-- markdownlint-disable-next-line first-line-heading --> ## Description <!-- Describe your changes in detail. --> ## Context <!-- Why is this change required? What problem does it solve? --> ## Type of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply. --> - [ ] Refactoring (non-breaking change) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would change existing functionality) - [ ] Bug fix (non-breaking change which fixes an issue) ## Checklist <!-- Go over all the following points, and put an `x` in all the boxes that apply. --> - [ ] I have followed the code style of the project - [ ] I have added tests to cover my changes - [ ] I have updated the documentation accordingly - [ ] This PR is a result of pair or mob programming - [ ] Exceptions/Exclusions to coding standards (e.g. #noqa or #NOSONAR) are included within this Pull Request. --- ## Sensitive Information Declaration To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including [PII (Personal Identifiable Information) / PID (Personal Identifiable Data)](https://digital.nhs.uk/data-and-information/keeping-data-safe-and-benefitting-the-public) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter. - [ ] I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.
2 parents c05a650 + ce3d5ca commit 3302750

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

gateway-api/tests/schema/test_openapi_schema.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,20 @@ def test_api_schema_compliance(case: Case, base_url: str) -> None:
4242
- Handles edge cases correctly
4343
- Validates inputs properly
4444
- Returns appropriate status codes
45-
46-
Note: Server error checks are disabled because the API may return 500 errors
47-
when testing with randomly generated NHS numbers that don't exist in the PDS.
4845
"""
4946

5047
case.headers["Ods-from"] = "test-ods-code"
5148
case.headers["Ssp-TraceID"] = "test-trace-id"
5249

5350
case.call_and_validate(
5451
base_url=base_url,
55-
excluded_checks=[schemathesis.checks.not_a_server_error],
52+
excluded_checks=[
53+
# GPCAPIM-421
54+
schemathesis.checks.not_a_server_error,
55+
# GPCAPIM-419
56+
schemathesis.checks.missing_required_header,
57+
# GPCAPIM-422
58+
schemathesis.checks.unsupported_method,
59+
],
5660
timeout=30,
5761
)

schemathesis.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[generation]
2-
mode = "positive"
2+
mode = "all"

0 commit comments

Comments
 (0)