How to use the schemathesis.checks.response_schema_conformance function in schemathesis

To help you get started, we’ve selected a few schemathesis examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kiwicom / schemathesis / test / runner / test_checks.py View on Github external
def test_response_schema_conformance_swagger(swagger_20, content, definition):
    response = make_response(content)
    case = make_case(swagger_20, definition)
    assert response_schema_conformance(response, case) is None
github kiwicom / schemathesis / test / runner / test_checks.py View on Github external
def test_response_schema_conformance_invalid_swagger(swagger_20, content, definition):
    response = make_response(content)
    case = make_case(swagger_20, definition)
    with pytest.raises(AssertionError):
        response_schema_conformance(response, case)
github kiwicom / schemathesis / test / runner / test_runner.py View on Github external
def test_response_conformance_text(args):
    app, kwargs = args
    # When endpoint returns a response that is not JSON
    # And "response_schema_conformance" is specified
    results = execute(**kwargs, checks=(response_schema_conformance,), hypothesis_options={"max_examples": 1})
    # Then the check should be ignored if the response headers are not application/json
    assert not results.has_failures
    assert not results.has_errors
github kiwicom / schemathesis / test / runner / test_checks.py View on Github external
def test_response_schema_conformance_openapi(openapi_30, content, definition):
    response = make_response(content)
    case = make_case(openapi_30, definition)
    assert response_schema_conformance(response, case) is None
github kiwicom / schemathesis / test / runner / test_checks.py View on Github external
def test_response_schema_conformance_invalid_openapi(openapi_30, content, definition):
    response = make_response(content)
    case = make_case(openapi_30, definition)
    with pytest.raises(AssertionError):
        response_schema_conformance(response, case)