Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 31 additions & 9 deletions tests/test_tutorial/test_fastapi/test_delete/test_tutorial001.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from types import ModuleType

import pytest
from dirty_equals import IsOneOf
from fastapi.testclient import TestClient
from sqlmodel import create_engine
from sqlmodel.pool import StaticPool
Expand Down Expand Up @@ -341,17 +342,38 @@ def test_tutorial(module: ModuleType):
"title": "ValidationError",
"required": ["loc", "msg", "type"],
"type": "object",
"properties": {
"loc": {
"title": "Location",
"type": "array",
"items": {
"anyOf": [{"type": "string"}, {"type": "integer"}]
"properties": IsOneOf(
{
"loc": {
"title": "Location",
"type": "array",
"items": {
"anyOf": [
{"type": "string"},
{"type": "integer"},
]
},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
},
{
"loc": {
"title": "Location",
"type": "array",
"items": {
"anyOf": [
{"type": "string"},
{"type": "integer"},
]
},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
"ctx": {"title": "Context", "type": "object"},
"input": {"title": "Input"},
},
),
},
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from types import ModuleType

import pytest
from dirty_equals import IsOneOf
from fastapi.testclient import TestClient
from sqlmodel import create_engine
from sqlmodel.pool import StaticPool
Expand Down Expand Up @@ -258,17 +259,38 @@ def test_tutorial(module: ModuleType):
"title": "ValidationError",
"required": ["loc", "msg", "type"],
"type": "object",
"properties": {
"loc": {
"title": "Location",
"type": "array",
"items": {
"anyOf": [{"type": "string"}, {"type": "integer"}]
"properties": IsOneOf(
{
"loc": {
"title": "Location",
"type": "array",
"items": {
"anyOf": [
{"type": "string"},
{"type": "integer"},
]
},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
},
{
"loc": {
"title": "Location",
"type": "array",
"items": {
"anyOf": [
{"type": "string"},
{"type": "integer"},
]
},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
"ctx": {"title": "Context", "type": "object"},
"input": {"title": "Input"},
},
),
},
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from types import ModuleType

import pytest
from dirty_equals import IsOneOf
from fastapi.testclient import TestClient
from sqlalchemy import inspect
from sqlalchemy.engine.reflection import Inspector
Expand Down Expand Up @@ -182,17 +183,38 @@ def test_tutorial(module: ModuleType):
"title": "ValidationError",
"required": ["loc", "msg", "type"],
"type": "object",
"properties": {
"loc": {
"title": "Location",
"type": "array",
"items": {
"anyOf": [{"type": "string"}, {"type": "integer"}]
"properties": IsOneOf(
{
"loc": {
"title": "Location",
"type": "array",
"items": {
"anyOf": [
{"type": "string"},
{"type": "integer"},
]
},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
},
{
"loc": {
"title": "Location",
"type": "array",
"items": {
"anyOf": [
{"type": "string"},
{"type": "integer"},
]
},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
"ctx": {"title": "Context", "type": "object"},
"input": {"title": "Input"},
},
),
},
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from types import ModuleType

import pytest
from dirty_equals import IsOneOf
from fastapi.testclient import TestClient
from sqlalchemy import inspect
from sqlalchemy.engine.reflection import Inspector
Expand Down Expand Up @@ -182,17 +183,38 @@ def test_tutorial(module: ModuleType):
"title": "ValidationError",
"required": ["loc", "msg", "type"],
"type": "object",
"properties": {
"loc": {
"title": "Location",
"type": "array",
"items": {
"anyOf": [{"type": "string"}, {"type": "integer"}]
"properties": IsOneOf(
{
"loc": {
"title": "Location",
"type": "array",
"items": {
"anyOf": [
{"type": "string"},
{"type": "integer"},
]
},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
},
{
"loc": {
"title": "Location",
"type": "array",
"items": {
"anyOf": [
{"type": "string"},
{"type": "integer"},
]
},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
"ctx": {"title": "Context", "type": "object"},
"input": {"title": "Input"},
},
),
},
}
},
Expand Down
40 changes: 31 additions & 9 deletions tests/test_tutorial/test_fastapi/test_read_one/test_tutorial001.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from types import ModuleType

import pytest
from dirty_equals import IsOneOf
from fastapi.testclient import TestClient
from sqlmodel import create_engine
from sqlmodel.pool import StaticPool
Expand Down Expand Up @@ -201,17 +202,38 @@ def test_tutorial(module: ModuleType):
"title": "ValidationError",
"required": ["loc", "msg", "type"],
"type": "object",
"properties": {
"loc": {
"title": "Location",
"type": "array",
"items": {
"anyOf": [{"type": "string"}, {"type": "integer"}]
"properties": IsOneOf(
{
"loc": {
"title": "Location",
"type": "array",
"items": {
"anyOf": [
{"type": "string"},
{"type": "integer"},
]
},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
},
{
"loc": {
"title": "Location",
"type": "array",
"items": {
"anyOf": [
{"type": "string"},
{"type": "integer"},
]
},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
"ctx": {"title": "Context", "type": "object"},
"input": {"title": "Input"},
},
),
},
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from types import ModuleType

import pytest
from dirty_equals import IsOneOf
from fastapi.testclient import TestClient
from sqlmodel import create_engine
from sqlmodel.pool import StaticPool
Expand Down Expand Up @@ -679,17 +680,38 @@ def test_tutorial(module: ModuleType):
"title": "ValidationError",
"required": ["loc", "msg", "type"],
"type": "object",
"properties": {
"loc": {
"title": "Location",
"type": "array",
"items": {
"anyOf": [{"type": "string"}, {"type": "integer"}]
"properties": IsOneOf(
{
"loc": {
"title": "Location",
"type": "array",
"items": {
"anyOf": [
{"type": "string"},
{"type": "integer"},
]
},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
},
{
"loc": {
"title": "Location",
"type": "array",
"items": {
"anyOf": [
{"type": "string"},
{"type": "integer"},
]
},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
"ctx": {"title": "Context", "type": "object"},
"input": {"title": "Input"},
},
),
},
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from types import ModuleType

import pytest
from dirty_equals import IsOneOf
from fastapi.testclient import TestClient
from sqlmodel import create_engine
from sqlmodel.pool import StaticPool
Expand Down Expand Up @@ -146,17 +147,38 @@ def test_tutorial(module: ModuleType):
"title": "ValidationError",
"required": ["loc", "msg", "type"],
"type": "object",
"properties": {
"loc": {
"title": "Location",
"type": "array",
"items": {
"anyOf": [{"type": "string"}, {"type": "integer"}]
"properties": IsOneOf(
{
"loc": {
"title": "Location",
"type": "array",
"items": {
"anyOf": [
{"type": "string"},
{"type": "integer"},
]
},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
},
{
"loc": {
"title": "Location",
"type": "array",
"items": {
"anyOf": [
{"type": "string"},
{"type": "integer"},
]
},
},
"msg": {"title": "Message", "type": "string"},
"type": {"title": "Error Type", "type": "string"},
"ctx": {"title": "Context", "type": "object"},
"input": {"title": "Input"},
},
),
},
}
},
Expand Down
Loading