- Sort Score
- Result 10 results
- Languages All
Results 1 - 4 of 4 for read_root (0.25 sec)
-
tests/test_computed_fields.py
width: int length: int @computed_field @property def area(self) -> int: return self.width * self.length @app.get("/") def read_root() -> Rectangle: return Rectangle(width=3, length=4) client = TestClient(app) return client @needs_pydanticv2 def test_get(client: TestClient): response = client.get("/")
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Aug 04 20:47:07 GMT 2023 - 2.2K bytes - Viewed (0) -
tests/test_response_model_invalid.py
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Feb 29 13:04:35 GMT 2020 - 1.1K bytes - Viewed (0) -
docs_src/using_request_directly/tutorial001.py
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Mar 26 19:09:53 GMT 2020 - 230 bytes - Viewed (0) -
tests/test_response_model_as_return_annotation.py
assert response.json() == {"foo": "bar"} def test_invalid_response_model_field(): app = FastAPI() with pytest.raises(FastAPIError) as e: @app.get("/") def read_root() -> Union[Response, None]: return Response(content="Foo") # pragma: no cover assert "valid Pydantic field type" in e.value.args[0] assert "parameter response_model=None" in e.value.args[0]
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Mon Aug 14 09:49:57 GMT 2023 - 47.7K bytes - Viewed (0)