- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 20 for 500 (0.28 sec)
-
tests/test_tutorial/test_dependencies/test_tutorial008d.py
from docs_src.dependencies.tutorial008d import app client = TestClient(app, raise_server_exceptions=False) response = client.get("/items/portal-gun") assert response.status_code == 500, response.text
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat Feb 24 23:06:37 GMT 2024 - 1.2K bytes - Viewed (0) -
tests/test_response_model_invalid.py
app = FastAPI() @app.get("/", responses={"500": {"model": NonPydanticModel}}) def read_root(): pass # pragma: nocover def test_invalid_response_model_sub_type_in_responses_raises(): with pytest.raises(FastAPIError): app = FastAPI() @app.get("/", responses={"500": {"model": List[NonPydanticModel]}}) def read_root():
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat Feb 29 13:04:35 GMT 2020 - 1.1K bytes - Viewed (0) -
docs/sts/client_grants/__init__.py
Python - Registered: Sun Apr 28 19:28:10 GMT 2024 - Last Modified: Fri Apr 23 18:58:53 GMT 2021 - 4.6K bytes - Viewed (1) -
tests/test_additional_responses_response_class.py
class JsonApiError(BaseModel): errors: typing.List[Error] @app.get( "/a", response_class=JsonApiResponse, responses={500: {"description": "Error", "model": JsonApiError}}, ) async def a(): pass # pragma: no cover @app.get("/b", responses={500: {"description": "Error", "model": Error}}) async def b(): pass # pragma: no cover client = TestClient(app)
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 3.5K bytes - Viewed (0) -
tests/test_response_code_no_body.py
status: str title: str class JsonApiError(BaseModel): errors: typing.List[Error] @app.get( "/a", status_code=204, response_class=JsonApiResponse, responses={500: {"description": "Error", "model": JsonApiError}}, ) async def a(): pass @app.get("/b", responses={204: {"description": "No Content"}}) async def b(): pass # pragma: no cover
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 3.2K bytes - Viewed (0) -
tests/test_include_router_defaults_overrides.py
async def callback5(level5: str): pass # pragma: nocover app = FastAPI( dependencies=[Depends(dep0)], responses={ 400: {"description": "Client error level 0"}, 500: {"description": "Server error level 0"}, }, default_response_class=ResponseLevel0, callbacks=callback_router0.routes, ) router2_override = APIRouter( prefix="/level2",
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 358.6K bytes - Viewed (0) -
tests/test_response_model_sub_types.py
name: str app = FastAPI() @app.get("/valid1", responses={"500": {"model": int}}) def valid1(): pass @app.get("/valid2", responses={"500": {"model": List[int]}}) def valid2(): pass @app.get("/valid3", responses={"500": {"model": Model}}) def valid3(): pass @app.get("/valid4", responses={"500": {"model": List[Model]}}) def valid4(): pass
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 5.3K bytes - Viewed (0) -
tests/test_tutorial/test_dependencies/test_tutorial008d_an.py
from docs_src.dependencies.tutorial008d_an import app client = TestClient(app, raise_server_exceptions=False) response = client.get("/items/portal-gun") assert response.status_code == 500, response.text
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat Feb 24 23:06:37 GMT 2024 - 1.2K bytes - Viewed (0) -
tests/test_response_class_no_mediatype.py
class JsonApiError(BaseModel): errors: typing.List[Error] @app.get( "/a", response_class=Response, responses={500: {"description": "Error", "model": JsonApiError}}, ) async def a(): pass # pragma: no cover @app.get("/b", responses={500: {"description": "Error", "model": Error}}) async def b(): pass # pragma: no cover client = TestClient(app)
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 3.3K bytes - Viewed (0) -
docs_src/sql_databases/sql_app_py310/alt_main.py
models.Base.metadata.create_all(bind=engine) app = FastAPI() @app.middleware("http") async def db_session_middleware(request: Request, call_next): response = Response("Internal server error", status_code=500) try: request.state.db = SessionLocal() response = await call_next(request) finally: request.state.db.close() return response # Dependency def get_db(request: Request):
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jan 07 14:11:31 GMT 2022 - 1.9K bytes - Viewed (0)