- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 16 for test_path_operations (0.08 sec)
-
tests/test_tutorial/test_metadata/test_tutorial004.py
from fastapi.testclient import TestClient from docs_src.metadata.tutorial004_py39 import app client = TestClient(app) def test_path_operations(): response = client.get("/items/") assert response.status_code == 200, response.text response = client.get("/users/") assert response.status_code == 200, response.text def test_openapi_schema(): response = client.get("/openapi.json")
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 2K bytes - Viewed (0) -
tests/test_response_model_sub_types.py
@app.get("/valid3", responses={"500": {"model": Model}}) def valid3(): pass @app.get("/valid4", responses={"500": {"model": list[Model]}}) def valid4(): pass client = TestClient(app) def test_path_operations(): response = client.get("/valid1") assert response.status_code == 200, response.text response = client.get("/valid2") assert response.status_code == 200, response.text
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 21:25:59 UTC 2025 - 5.2K bytes - Viewed (0) -
tests/test_additional_response_extra.py
@sub_router.get("/") def read_item(): return {"id": "foo"} router.include_router(sub_router, prefix="/items") app.include_router(router) client = TestClient(app) def test_path_operation(): response = client.get("/items/") assert response.status_code == 200, response.text assert response.json() == {"id": "foo"} def test_openapi_schema(): response = client.get("/openapi.json")
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 1.2K bytes - Viewed (0) -
tests/test_tutorial/test_response_change_status_code/test_tutorial001.py
from fastapi.testclient import TestClient from docs_src.response_change_status_code.tutorial001_py39 import app client = TestClient(app) def test_path_operation(): response = client.put("/get-or-create-task/foo") print(response.content) assert response.status_code == 200, response.text assert response.json() == "Listen to the Bar Fighters" response = client.put("/get-or-create-task/bar")
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 526 bytes - Viewed (0) -
tests/test_tutorial/test_additional_responses/test_tutorial002.py
mod = importlib.import_module(f"docs_src.additional_responses.{request.param}") client = TestClient(mod.app) client.headers.clear() return client def test_path_operation(client: TestClient): response = client.get("/items/foo") assert response.status_code == 200, response.text assert response.json() == {"id": "foo", "value": "there goes my hero"}
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 4.7K bytes - Viewed (0) -
tests/test_tutorial/test_response_cookies/test_tutorial001.py
from fastapi.testclient import TestClient from docs_src.response_cookies.tutorial001_py39 import app client = TestClient(app) def test_path_operation(): response = client.post("/cookie/") assert response.status_code == 200, response.text assert response.json() == {"message": "Come to the dark side, we have cookies"}
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 408 bytes - Viewed (0) -
tests/test_tutorial/test_response_cookies/test_tutorial002.py
from fastapi.testclient import TestClient from docs_src.response_cookies.tutorial002_py39 import app client = TestClient(app) def test_path_operation(): response = client.post("/cookie-and-object/") assert response.status_code == 200, response.text assert response.json() == {"message": "Come to the dark side, we have cookies"}
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 419 bytes - Viewed (0) -
tests/test_tutorial/test_response_headers/test_tutorial002.py
from fastapi.testclient import TestClient from docs_src.response_headers.tutorial002_py39 import app client = TestClient(app) def test_path_operation(): response = client.get("/headers-and-object/") assert response.status_code == 200, response.text assert response.json() == {"message": "Hello World"}
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 383 bytes - Viewed (0) -
tests/test_tutorial/test_response_headers/test_tutorial001.py
from fastapi.testclient import TestClient from docs_src.response_headers.tutorial001_py39 import app client = TestClient(app) def test_path_operation(): response = client.get("/headers/") assert response.status_code == 200, response.text assert response.json() == {"message": "Hello World"} assert response.headers["X-Cat-Dog"] == "alone in the world"
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 431 bytes - Viewed (0) -
tests/test_tutorial/test_additional_responses/test_tutorial004.py
mod = importlib.import_module(f"docs_src.additional_responses.{request.param}") client = TestClient(mod.app) client.headers.clear() return client def test_path_operation(client: TestClient): response = client.get("/items/foo") assert response.status_code == 200, response.text assert response.json() == {"id": "foo", "value": "there goes my hero"}
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 4.9K bytes - Viewed (0)