- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 563 for def (0.01 sec)
-
tests/main.py
def get_str_id(item_id: str): return item_id @app.get("/path/int/{item_id}") def get_int_id(item_id: int): return item_id @app.get("/path/float/{item_id}") def get_float_id(item_id: float): return item_id @app.get("/path/bool/{item_id}") def get_bool_id(item_id: bool): return item_id @app.get("/path/param/{item_id}") def get_path_param_id(item_id: Optional[str] = Path()):
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 21:56:59 UTC 2024 - 4.3K bytes - Viewed (0) -
tests/test_dependency_contextmanager.py
async def context_b(state: dict = Depends(context_a)): state["context_b"] = "started b" try: yield state finally: state["context_b"] = f"finished b with a: {state['context_a']}" @app.get("/async") async def get_async(state: str = Depends(asyncgen_state)): return state @app.get("/sync") async def get_sync(state: str = Depends(generator_state)):
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Aug 17 04:13:50 UTC 2024 - 11.6K bytes - Viewed (0) -
tests/test_jsonable_encoder.py
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 21:56:59 UTC 2024 - 9K bytes - Viewed (0) -
tests/test_multipart_installation.py
with pytest.raises(RuntimeError, match=multipart_incorrect_install_error): app = FastAPI() @app.post("/") async def root(username: str = Form()): return username # pragma: nocover def test_incorrect_multipart_installed_file_upload(monkeypatch): monkeypatch.setattr("python_multipart.__version__", "0.0.12") with warnings.catch_warnings(record=True):
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 27 21:46:26 UTC 2024 - 5.7K bytes - Viewed (0) -
tests/test_router_events.py
def app_startup() -> None: state.app_startup = True @app.on_event("shutdown") def app_shutdown() -> None: state.app_shutdown = True router = APIRouter() @router.on_event("startup") def router_startup() -> None: state.router_startup = True @router.on_event("shutdown") def router_shutdown() -> None: state.router_shutdown = True
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Aug 24 19:09:52 UTC 2024 - 7.3K bytes - Viewed (0) -
fastapi/_compat.py
@property def alias(self) -> str: a = self.field_info.alias return a if a is not None else self.name @property def required(self) -> bool: return self.field_info.is_required() @property def default(self) -> Any: return self.get_default() @property def type_(self) -> Any:
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Oct 12 09:36:32 UTC 2024 - 23.4K bytes - Viewed (0) -
build-logic/binary-compatibility/src/main/groovy/gradlebuild.binary-compatibility.gradle
) def compatibilityBaselineVersion = moduleIdentity.releasedVersions.get().mostRecentRelease.version def ARTIFACT_TYPE = Attribute.of('artifactType', String) def RUNTIME_ATTRIBUTE = objects.named(Usage, Usage.JAVA_RUNTIME) def DOCUMENTATION_ATTRIBUTE = objects.named(Category, Category.DOCUMENTATION) def SOURCES_ATTRIBUTE = objects.named(DocsType, "gradle-source-folders")
Registered: Wed Nov 06 11:36:14 UTC 2024 - Last Modified: Fri Jul 26 08:15:16 UTC 2024 - 9.1K bytes - Viewed (0) -
tests/test_tutorial/test_security/test_tutorial005_an_py39.py
from dirty_equals import IsDict, IsOneOf from fastapi.testclient import TestClient from ...utils import needs_py39 @pytest.fixture(name="client") def get_client(): from docs_src.security.tutorial005_an_py39 import app client = TestClient(app) return client def get_access_token( *, username="johndoe", password="secret", scope=None, client: TestClient ): data = {"username": username, "password": password}
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Wed Mar 13 19:07:10 UTC 2024 - 16.3K bytes - Viewed (0) -
tests/test_inherited_custom_class.py
from .utils import needs_pydanticv1, needs_pydanticv2 class MyUuid: def __init__(self, uuid_string: str): self.uuid = uuid_string def __str__(self): return self.uuid @property # type: ignore def __class__(self): return uuid.UUID @property def __dict__(self): """Spoof a missing __dict__ by raising TypeError, this is how
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Aug 17 04:13:50 UTC 2024 - 3K bytes - Viewed (0) -
tests/test_query.py
] } ) def test_query_optional(): response = client.get("/query/optional") assert response.status_code == 200 assert response.json() == "foo bar" def test_query_optional_query_baz(): response = client.get("/query/optional?query=baz") assert response.status_code == 200 assert response.json() == "foo bar baz" def test_query_optional_not_declared_baz():
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 21:56:59 UTC 2024 - 11.4K bytes - Viewed (0)