Skip to content

Commit

Permalink
fix imports
Browse files Browse the repository at this point in the history
  • Loading branch information
ric-evans committed Apr 12, 2024
1 parent 32d6462 commit fdcfbe6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/integrate_openapi/request_and_validate_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import requests
import tornado
from jsonschema_path import SchemaPath
from openapi_core.validation.response import exceptions

from openapi_core.validation.response.exceptions import DataValidationError
from openapi_core.templating.responses.exceptions import ResponseNotFound
from rest_tools.client import RestClient
from rest_tools.client.utils import request_and_validate
from rest_tools.server import RestServer, RestHandler
Expand Down Expand Up @@ -149,21 +149,21 @@ async def test_010__invalid(server: Callable[[], RestClient]) -> None:

# validate response data

with pytest.raises(exceptions.DataValidationError):
with pytest.raises(DataValidationError):
await request_and_validate(
rc, OPENAPI_SPEC, "POST", "/echo/this", {"echo": 123}
)

with pytest.raises(exceptions.DataValidationError):
with pytest.raises(DataValidationError):
await request_and_validate(
rc, OPENAPI_SPEC, "POST", "/echo/this", {"echo": {"foo": "string"}}
)

with pytest.raises(exceptions.DataValidationError):
with pytest.raises(DataValidationError):
await request_and_validate(rc, OPENAPI_SPEC, "POST", "/echo/this", {"baz": 123})

# validate response error
with pytest.raises(exceptions.DataValidationError) as e:
with pytest.raises(ResponseNotFound) as e:
await request_and_validate(
rc,
OPENAPI_SPEC,
Expand Down

0 comments on commit fdcfbe6

Please sign in to comment.