Skip to content

Commit

Permalink
test: Add a test for #738 (#761)
Browse files Browse the repository at this point in the history
  • Loading branch information
Stranger6667 committed Oct 1, 2020
1 parent d66336a commit edabef6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import pytest
import requests
from hypothesis import given, settings

import schemathesis
from schemathesis.models import Case, Endpoint, Request, Response
Expand Down Expand Up @@ -58,6 +59,18 @@ def test_call(override, base_url, swagger_20):
assert not records


@pytest.mark.endpoints("success")
def test_call_and_validate(openapi3_schema_url):
api_schema = schemathesis.from_uri(openapi3_schema_url)

@given(case=api_schema["/success"]["GET"].as_strategy())
@settings(max_examples=1)
def test(case):
case.call_and_validate()

test()


def test_case_partial_deepcopy(swagger_20):
endpoint = Endpoint("/example/path", "GET", {}, swagger_20)
original_case = Case(
Expand Down

0 comments on commit edabef6

Please sign in to comment.