- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 12 for ValueError (0.22 sec)
-
docs/sts/client_grants/sts_element.py
from xml.etree import cElementTree from xml.etree.cElementTree import ParseError if hasattr(cElementTree, 'ParseError'): _ETREE_EXCEPTIONS = (ParseError, AttributeError, ValueError, TypeError) else: _ETREE_EXCEPTIONS = (SyntaxError, AttributeError, ValueError, TypeError) _STS_NS = {'sts': 'https://sts.amazonaws.com/doc/2011-06-15/'} class STSElement(object): """STS aware XML parsing class. Wraps a root element name and
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Fri Apr 23 18:58:53 UTC 2021 - 2.5K bytes - Viewed (0) -
tests/test_additional_responses_bad.py
"get": { "responses": { # this is how one would imagine the openapi schema to be # but since the key is not valid, openapi.utils.get_openapi will raise ValueError "hello": {"description": "Not a valid additional response"}, "200": { "description": "Successful Response",
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 1.1K bytes - Viewed (0) -
tests/test_datastructures.py
from fastapi.testclient import TestClient # TODO: remove when deprecating Pydantic v1 def test_upload_file_invalid(): with pytest.raises(ValueError): UploadFile.validate("not a Starlette UploadFile") def test_upload_file_invalid_pydantic_v2(): with pytest.raises(ValueError): UploadFile._validate("not a Starlette UploadFile", {}) def test_default_placeholder_equals(): placeholder_1 = Default("a")
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Wed Oct 18 12:36:40 UTC 2023 - 2K bytes - Viewed (0) -
tests/test_filter_pydantic_sub_model_pv2.py
foo: ModelB @field_validator("name") def lower_username(cls, name: str, info: ValidationInfo): if not name.endswith("A"): raise ValueError("name must end in A") return name async def get_model_c() -> ModelC: return ModelC(username="test-user", password="test-password") @app.get("/model/{name}", response_model=ModelA)
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 19:40:57 UTC 2024 - 6.3K bytes - Viewed (0) -
tests/test_filter_pydantic_sub_model/app_pv1.py
name: str description: Optional[str] = None model_b: ModelB @validator("name") def lower_username(cls, name: str, values): if not name.endswith("A"): raise ValueError("name must end in A") return name async def get_model_c() -> ModelC: return ModelC(username="test-user", password="test-password") @app.get("/model/{name}", response_model=ModelA)
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jul 07 17:12:13 UTC 2023 - 784 bytes - Viewed (0) -
fastapi/datastructures.py
if not isinstance(v, StarletteUploadFile): raise ValueError(f"Expected UploadFile, received: {type(v)}") return v @classmethod def _validate(cls, __input_value: Any, _: Any) -> "UploadFile": if not isinstance(__input_value, StarletteUploadFile): raise ValueError(f"Expected UploadFile, received: {type(__input_value)}") return cast(UploadFile, __input_value)
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Tue Apr 02 02:48:51 UTC 2024 - 5.6K bytes - Viewed (0) -
tests/test_jsonable_encoder.py
assert jsonable_encoder(item, exclude={}) == {"name": "foo", "count": 100} def test_encode_unsupported(): unserializable = Unserializable() with pytest.raises(ValueError): jsonable_encoder(unserializable) @needs_pydanticv2 def test_encode_custom_json_encoders_model_pydanticv2(): from pydantic import field_serializer
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 21:56:59 UTC 2024 - 9K bytes - Viewed (0) -
scripts/mkdocs_hooks.py
elif isinstance(values[0], list): resolve_files(items=values[0], files=files, config=config) else: raise ValueError(f"Unexpected value: {values}") def on_files(files: Files, *, config: MkDocsConfig) -> Files: resolve_files(items=config.nav or [], files=files, config=config) if "logo" in config.theme:
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Aug 17 21:20:31 UTC 2024 - 5.2K bytes - Viewed (0) -
fastapi/security/http.py
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Sep 19 09:47:28 UTC 2024 - 13.2K bytes - Viewed (0) -
fastapi/encoders.py
except Exception as e: errors: List[Exception] = [] errors.append(e) try: data = vars(obj) except Exception as e: errors.append(e) raise ValueError(errors) from e return jsonable_encoder( data, include=include, exclude=exclude, by_alias=by_alias, exclude_unset=exclude_unset,
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 21:56:59 UTC 2024 - 10.8K bytes - Viewed (0)