Skip to content

DTOSS-8330-Schema-Validation-Integration-Tests#53

Merged
TomSmithCoding merged 1 commit intomainfrom
DTOSS-8330-Validate-Schema-Outgoing-Requests
Apr 11, 2025
Merged

DTOSS-8330-Schema-Validation-Integration-Tests#53
TomSmithCoding merged 1 commit intomainfrom
DTOSS-8330-Validate-Schema-Outgoing-Requests

Conversation

@TomSmithCoding
Copy link
Contributor

Added schema validation to the existing integration tests to validate our request bodys for outgoing POST requests, added schema layout as fixture in conftest

@TomSmithCoding TomSmithCoding added this pull request to the merge queue Apr 11, 2025
Merged via the queue into main with commit 6832691 Apr 11, 2025
10 checks passed
@TomSmithCoding TomSmithCoding deleted the DTOSS-8330-Validate-Schema-Outgoing-Requests branch April 11, 2025 09:14
try:
validate(instance=adapter.last_request.json(), schema=request_schema)
except ValidationError as e:
return False, e.message
Copy link
Contributor

@steventux steventux Apr 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TomSmithCoding Does this and the following return statement exit the test here? Would it be better to use an assertion or pytest.fail so that the test can continue and pick up any other failures?
eg.

    except ValidationError as e:
        pytest.fail(f"Invalid request body: {e}")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants