- Sort Score
- Result 10 results
- Languages All
Results 11 - 20 of 1,452 for def (0.02 sec)
-
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/documentation/src/test/groovy/gradlebuild/docs/dsl/docbook/ClassDocRendererTest.groovy
def propertiesSection = withCategories { content.section.find { it.title[0].text().trim() == 'Properties' } } def propertyDetailsSection = withCategories { content.section.find { it.title[0].text().trim() == 'Property details' } } def propertiesTable = withCategories { propertiesSection ? propertiesSection.table[0] : parse('<table/>')}
Registered: Wed Nov 06 11:36:14 UTC 2024 - Last Modified: Wed Dec 09 08:14:05 UTC 2020 - 40.8K bytes - Viewed (0) -
tests/test_response_by_alias.py
def by_alias_dict(): return {"alias": "Foo"} @app.get("/by-alias/model", response_model=Model) def by_alias_model(): return Model(alias="Foo") @app.get("/by-alias/list", response_model=List[Model]) def by_alias_list(): return [{"alias": "Foo"}, {"alias": "Bar"}] @app.get("/no-alias/dict", response_model=ModelNoAlias) def no_alias_dict(): return {"name": "Foo"}
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jul 07 17:12:13 UTC 2023 - 11.1K bytes - Viewed (0) -
tests/test_default_response_class.py
@router_a_a.get("/") def get_a_a(): return {"msg": "Hello A A"} @router_a_a.get("/override", response_class=PlainTextResponse) def get_a_a_path_override(): return "Hello A A" @router_a_b_override.get("/") def get_a_b(): return "Hello A B" @router_a_b_override.get("/override", response_class=HTMLResponse) def get_a_b_path_override(): return "Hello A B" @router_b_override.get("/") def get_b():
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Mar 01 20:49:20 UTC 2020 - 5.2K 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_validate_response.py
owner_ids: Optional[List[int]] = None @app.get("/items/invalid", response_model=Item) def get_invalid(): return {"name": "invalid", "price": "foo"} @app.get("/items/invalidnone", response_model=Item) def get_invalid_none(): return None @app.get("/items/validnone", response_model=Union[Item, None]) def get_valid_none(send_none: bool = False): if send_none: return None else:
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jul 07 17:12:13 UTC 2023 - 2K bytes - Viewed (0) -
tests/test_exception_handlers.py
client = TestClient(app) @app.get("/http-exception") def route_with_http_exception(): raise HTTPException(status_code=400) @app.get("/request-validation/{param}/") def route_with_request_validation_exception(param: int): pass # pragma: no cover @app.get("/server-error") def route_with_server_error(): raise RuntimeError("Oops!") def test_override_http_exception():
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Feb 17 12:40:12 UTC 2022 - 1.9K 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_skip_defaults.py
) def get_exclude_unset_none() -> ModelDefaults: return ModelDefaults(x=None, y="y") client = TestClient(app) def test_return_defaults(): response = client.get("/") assert response.json() == {"sub": {}} def test_return_exclude_unset(): response = client.get("/exclude_unset") assert response.json() == {"x": None, "y": "y"} def test_return_exclude_defaults():
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jul 07 17:12:13 UTC 2023 - 2K 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)