Closed radekjg closed 2 years ago
Merging #258 (a1f810c) into master (53e6b88) will not change coverage. The diff coverage is
100.0%
.
@@ Coverage Diff @@
## master #258 +/- ##
=======================================
Coverage 100.0% 100.0%
=======================================
Files 8 8
Lines 476 476
Branches 96 96
=======================================
Hits 476 476
Impacted Files | Coverage Ξ | |
---|---|---|
openapi_tester/schema_tester.py | 100.0% <100.0%> (ΓΈ) |
Trying to review on a very small screen, so need some help understanding the changes made: do you want the library to support a case like this?
schema_tester = SchemaTester()
def my_test(client):
response = client.get('api/v1/...')
assert response.status_code == 204
schema_tester.validate_response(response=response, ...)
will this change allow you to detect a missing response? I.e., will the test fail if response.data is missing and the schema documents an actual response?
Seems like a good change in general π
If schema documents a response, the if before (that gets the content
key will fail because response content won't match the spec)
This looks good @radowit π Would you mind rebasing on master and updating the version in pyproject.toml
to v2.0.1? I'll release a new version shortly after
Thanks @radowit!
Empty response worked only if
response.json
returned something. But if a response data is not json-serializable schema tester raises an error.