- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 30 for Case (0.13 sec)
-
docs_src/sql_databases/sql_app_py310/database.py
from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker SQLALCHEMY_DATABASE_URL = "sqlite:///./sql_app.db" # SQLALCHEMY_DATABASE_URL = "postgresql://user:password@postgresserver/db" engine = create_engine( SQLALCHEMY_DATABASE_URL, connect_args={"check_same_thread": False} ) SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Jan 07 14:11:31 GMT 2022 - 461 bytes - Viewed (0) -
fastapi/utils.py
original_type = cast(Type[BaseModel], original_type) use_type = cloned_types.get(original_type) if use_type is None: use_type = create_model(original_type.__name__, __base__=original_type) cloned_types[original_type] = use_type for f in original_type.__fields__.values(): use_type.__fields__[f.name] = create_cloned_field(
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:40:57 GMT 2024 - 7.8K bytes - Viewed (0) -
tests/test_security_http_base.py
client = TestClient(app) def test_security_http_base(): response = client.get("/users/me", headers={"Authorization": "Other foobar"}) assert response.status_code == 200, response.text assert response.json() == {"scheme": "Other", "credentials": "foobar"} def test_security_http_base_no_credentials(): response = client.get("/users/me")
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 1.7K bytes - Viewed (0) -
tests/test_security_http_base_optional.py
client = TestClient(app) def test_security_http_base(): response = client.get("/users/me", headers={"Authorization": "Other foobar"}) assert response.status_code == 200, response.text assert response.json() == {"scheme": "Other", "credentials": "foobar"} def test_security_http_base_no_credentials(): response = client.get("/users/me")
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 1.9K bytes - Viewed (0) -
tests/test_operations_signatures.py
def test_signatures_consistency(): base_sig = inspect.signature(APIRouter.get) for method_name in method_names: router_method = getattr(APIRouter, method_name) app_method = getattr(FastAPI, method_name) router_sig = inspect.signature(router_method) app_sig = inspect.signature(app_method) param: inspect.Parameter for key, param in base_sig.parameters.items():
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Mon May 27 12:08:13 GMT 2019 - 934 bytes - Viewed (0) -
docs_src/sql_databases/sql_app_py39/tests/test_sql_app.py
from sqlalchemy.orm import sessionmaker from ..database import Base from ..main import app, get_db SQLALCHEMY_DATABASE_URL = "sqlite:///./test.db" engine = create_engine( SQLALCHEMY_DATABASE_URL, connect_args={"check_same_thread": False} ) TestingSessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine) Base.metadata.create_all(bind=engine) def override_get_db(): try:
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Jan 07 14:11:31 GMT 2022 - 1.2K bytes - Viewed (0) -
docs_src/async_tests/test_main.py
import pytest from httpx import AsyncClient from .main import app @pytest.mark.anyio async def test_root(): async with AsyncClient(app=app, base_url="http://test") as ac: response = await ac.get("/") assert response.status_code == 200
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Wed Oct 06 15:32:11 GMT 2021 - 306 bytes - Viewed (0) -
tests/test_tutorial/test_advanced_middleware/test_tutorial001.py
from fastapi.testclient import TestClient from docs_src.advanced_middleware.tutorial001 import app def test_middleware(): client = TestClient(app, base_url="https://testserver") response = client.get("/") assert response.status_code == 200, response.text client = TestClient(app) response = client.get("/", follow_redirects=False) assert response.status_code == 307, response.text
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sun Nov 13 14:26:09 GMT 2022 - 474 bytes - Viewed (0) -
fastapi/dependencies/models.py
from typing import Any, Callable, List, Optional, Sequence from fastapi._compat import ModelField from fastapi.security.base import SecurityBase class SecurityRequirement: def __init__( self, security_scheme: SecurityBase, scopes: Optional[Sequence[str]] = None ): self.security_scheme = security_scheme self.scopes = scopes class Dependant: def __init__( self, *,
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Jul 07 17:12:13 GMT 2023 - 2.4K bytes - Viewed (0) -
docs_src/path_operation_advanced_configuration/tutorial002.py
names. Should be called only after all routes have been added. """ for route in app.routes: if isinstance(route, APIRoute): route.operation_id = route.name # in this case, 'read_items'
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Mar 26 19:09:53 GMT 2020 - 572 bytes - Viewed (0)