|
|
|
@ -6,7 +6,10 @@ from pydantic import BaseModel |
|
|
|
|
|
|
|
|
|
|
|
def test_invalid_sequence(): |
|
|
|
with pytest.raises(AssertionError): |
|
|
|
with pytest.raises( |
|
|
|
AssertionError, |
|
|
|
match="Query param 'q' must be of one of the supported types", |
|
|
|
): |
|
|
|
app = FastAPI() |
|
|
|
|
|
|
|
class Item(BaseModel): |
|
|
|
@ -18,7 +21,10 @@ def test_invalid_sequence(): |
|
|
|
|
|
|
|
|
|
|
|
def test_invalid_tuple(): |
|
|
|
with pytest.raises(AssertionError): |
|
|
|
with pytest.raises( |
|
|
|
AssertionError, |
|
|
|
match="Query param 'q' must be of one of the supported types", |
|
|
|
): |
|
|
|
app = FastAPI() |
|
|
|
|
|
|
|
class Item(BaseModel): |
|
|
|
@ -30,7 +36,10 @@ def test_invalid_tuple(): |
|
|
|
|
|
|
|
|
|
|
|
def test_invalid_dict(): |
|
|
|
with pytest.raises(AssertionError): |
|
|
|
with pytest.raises( |
|
|
|
AssertionError, |
|
|
|
match="Query param 'q' must be of one of the supported types", |
|
|
|
): |
|
|
|
app = FastAPI() |
|
|
|
|
|
|
|
class Item(BaseModel): |
|
|
|
@ -42,7 +51,10 @@ def test_invalid_dict(): |
|
|
|
|
|
|
|
|
|
|
|
def test_invalid_simple_dict(): |
|
|
|
with pytest.raises(AssertionError): |
|
|
|
with pytest.raises( |
|
|
|
AssertionError, |
|
|
|
match="Query param 'q' must be of one of the supported types", |
|
|
|
): |
|
|
|
app = FastAPI() |
|
|
|
|
|
|
|
class Item(BaseModel): |
|
|
|
|