- Sort Score
- Result 10 results
- Languages All
Results 1 - 4 of 4 for test_invalid_response_model (0.2 sec)
-
tests/test_response_model_invalid.py
from fastapi.exceptions import FastAPIError class NonPydanticModel: pass def test_invalid_response_model_raises(): with pytest.raises(FastAPIError): app = FastAPI() @app.get("/", response_model=NonPydanticModel) def read_root(): pass # pragma: nocover def test_invalid_response_model_sub_type_raises(): with pytest.raises(FastAPIError): app = FastAPI()
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Feb 29 13:04:35 GMT 2020 - 1.1K bytes - Viewed (0) -
tests/test_tutorial/test_response_model/test_tutorial003_04.py
import pytest from fastapi.exceptions import FastAPIError def test_invalid_response_model(): with pytest.raises(FastAPIError): from docs_src.response_model.tutorial003_04 import app
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Tue Jan 10 16:22:47 GMT 2023 - 236 bytes - Viewed (0) -
tests/test_tutorial/test_response_model/test_tutorial003_04_py310.py
import pytest from fastapi.exceptions import FastAPIError from ...utils import needs_py310 @needs_py310 def test_invalid_response_model(): with pytest.raises(FastAPIError): from docs_src.response_model.tutorial003_04_py310 import app
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Tue Jan 10 16:22:47 GMT 2023 - 289 bytes - Viewed (0) -
tests/test_response_model_as_return_annotation.py
response = client.get("/no_response_model-annotation_json_response_class") assert response.status_code == 200, response.text assert response.json() == {"foo": "bar"} def test_invalid_response_model_field(): app = FastAPI() with pytest.raises(FastAPIError) as e: @app.get("/") def read_root() -> Union[Response, None]:
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Mon Aug 14 09:49:57 GMT 2023 - 47.7K bytes - Viewed (0)