- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 160 for raised (0.2 sec)
-
tests/test_custom_middleware_exception.py
"name": "ContentSizeLimitExceeded", "code": 999, "message": "File limit exceeded", } } def test_custom_middleware_exception_not_raised(tmp_path: Path): path = tmp_path / "test.txt" path.write_bytes(b"<file content>") with client: with open(path, "rb") as file: response = client.post("/middleware", files={"file": file})
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Aug 25 21:44:40 GMT 2022 - 2.8K bytes - Viewed (0) -
docs/en/docs/tutorial/dependencies/dependencies-with-yield.md
Note over client,operation: Can raise exceptions, including HTTPException client ->> dep: Start request Note over dep: Run code up to yield opt raise Exception dep -->> handler: Raise Exception handler -->> client: HTTP error response end dep ->> operation: Run dependency, e.g. DB session opt raise operation -->> dep: Raise Exception (e.g. HTTPException) opt handle
Plain Text - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat Feb 24 23:06:37 GMT 2024 - 14.1K bytes - Viewed (0) -
docs/en/docs/reference/websockets.md
- iter_bytes - iter_json - send_text - send_bytes - send_json - close When a client disconnects, a `WebSocketDisconnect` exception is raised, you can catch it. You can import it directly form `fastapi`: ```python from fastapi import WebSocketDisconnect ``` ::: fastapi.WebSocketDisconnect ## WebSockets - additional classes
Plain Text - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 1.6K bytes - Viewed (0) -
tests/test_tutorial/test_websockets/test_tutorial002_an.py
client = TestClient(app) with pytest.raises(WebSocketDisconnect): with client.websocket_connect("/items/foo/ws"): pytest.fail( "did not raise WebSocketDisconnect on __enter__" ) # pragma: no cover def test_websocket_invalid_data(): client = TestClient(app) with pytest.raises(WebSocketDisconnect):
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat Mar 18 12:29:59 GMT 2023 - 3.6K bytes - Viewed (0) -
docs/en/docs/tutorial/handling-errors.md
Plain Text - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Mar 22 01:42:11 GMT 2024 - 9.1K bytes - Viewed (0) -
tests/test_jsonable_encoder.py
def test_encode_model_with_config(): model = ModelWithConfig(role=RoleEnum.admin) assert jsonable_encoder(model) == {"role": "admin"} def test_encode_model_with_alias_raises(): with pytest.raises(ValidationError): ModelWithAlias(foo="Bar") def test_encode_model_with_alias(): model = ModelWithAlias(Foo="Bar") assert jsonable_encoder(model) == {"Foo": "Bar"}
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Apr 18 21:56:59 GMT 2024 - 9K bytes - Viewed (0) -
tests/test_response_model_invalid.py
class NonPydanticModel: pass def test_invalid_response_model_raises(): with pytest.raises(FastAPIError): app = FastAPI() @app.get("/", response_model=NonPydanticModel) def read_root(): pass # pragma: nocover def test_invalid_response_model_sub_type_raises(): with pytest.raises(FastAPIError): app = FastAPI()
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Sat Feb 29 13:04:35 GMT 2020 - 1.1K bytes - Viewed (0) -
tests/test_multipart_installation.py
with pytest.raises(RuntimeError, match=multipart_incorrect_install_error): app = FastAPI() @app.post("/") async def root(f: bytes = File()): return f # pragma: nocover def test_incorrect_multipart_installed_multi_form(monkeypatch): monkeypatch.delattr("multipart.multipart.parse_options_header", raising=False)
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri May 13 23:38:22 GMT 2022 - 3.7K bytes - Viewed (0) -
tests/test_ambiguous_params.py
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Tue Dec 12 00:22:47 GMT 2023 - 2.1K bytes - Viewed (0) -
docs_src/app_testing/app_b_py310/main.py
if x_token != fake_secret_token: raise HTTPException(status_code=400, detail="Invalid X-Token header") if item_id not in fake_db: raise HTTPException(status_code=404, detail="Item not found") return fake_db[item_id] @app.post("/items/", response_model=Item) async def create_item(item: Item, x_token: str = Header()): if x_token != fake_secret_token:
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Tue Jan 09 14:44:08 GMT 2024 - 1.1K bytes - Viewed (0)