- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 89 for test_get (0.13 sec)
-
tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial002.py
from fastapi.testclient import TestClient from docs_src.path_operation_advanced_configuration.tutorial002 import app client = TestClient(app) def test_get(): response = client.get("/items/") assert response.status_code == 200, response.text assert response.json() == [{"item_id": "Foo"}] def test_openapi_schema(): response = client.get("/openapi.json") assert response.status_code == 200, response.text
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 1020 bytes - Viewed (0) -
tests/test_tutorial/test_custom_response/test_tutorial009c.py
from fastapi.testclient import TestClient from docs_src.custom_response.tutorial009c import app client = TestClient(app) def test_get(): response = client.get("/")
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Sep 01 09:32:30 UTC 2022 - 239 bytes - Viewed (0) -
tests/test_tutorial/test_custom_response/test_tutorial007.py
from fastapi.testclient import TestClient from docs_src.custom_response.tutorial007 import app client = TestClient(app) def test_get(): fake_content = b"some fake video bytes" response = client.get("/")
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Jul 09 18:06:12 UTC 2020 - 264 bytes - Viewed (0) -
tests/test_tutorial/test_custom_response/test_tutorial008.py
from pathlib import Path from fastapi.testclient import TestClient from docs_src.custom_response import tutorial008 from docs_src.custom_response.tutorial008 import app client = TestClient(app) def test_get(tmp_path: Path): file_path: Path = tmp_path / "large-video-file.mp4" tutorial008.some_file_path = str(file_path) test_content = b"Fake video bytes" file_path.write_bytes(test_content) response = client.get("/")
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Jul 09 18:06:12 UTC 2020 - 487 bytes - Viewed (0) -
tests/test_tutorial/test_custom_response/test_tutorial009.py
from pathlib import Path from fastapi.testclient import TestClient from docs_src.custom_response import tutorial009 from docs_src.custom_response.tutorial009 import app client = TestClient(app) def test_get(tmp_path: Path): file_path: Path = tmp_path / "large-video-file.mp4" tutorial009.some_file_path = str(file_path) test_content = b"Fake video bytes" file_path.write_bytes(test_content) response = client.get("/")
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Jul 03 19:51:28 UTC 2021 - 487 bytes - Viewed (0) -
tests/test_tutorial/test_custom_request_and_route/test_tutorial003.py
from fastapi.testclient import TestClient from docs_src.custom_request_and_route.tutorial003 import app client = TestClient(app) def test_get(): response = client.get("/") assert response.json() == {"message": "Not timed"} assert "X-Response-Time" not in response.headers def test_get_timed(): response = client.get("/timed") assert response.json() == {"message": "It's the time of my life"}
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Jul 09 18:06:12 UTC 2020 - 526 bytes - Viewed (0) -
tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial005.py
from fastapi.testclient import TestClient from docs_src.path_operation_advanced_configuration.tutorial005 import app client = TestClient(app) def test_get(): response = client.get("/items/") assert response.status_code == 200, response.text def test_openapi_schema(): response = client.get("/openapi.json") assert response.status_code == 200, response.text assert response.json() == { "openapi": "3.1.0",
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 1K bytes - Viewed (0) -
tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial001.py
from fastapi.testclient import TestClient from docs_src.path_operation_advanced_configuration.tutorial001 import app client = TestClient(app) def test_get(): response = client.get("/items/") assert response.status_code == 200, response.text assert response.json() == [{"item_id": "Foo"}] def test_openapi_schema(): response = client.get("/openapi.json") assert response.status_code == 200, response.text
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 1K bytes - Viewed (0) -
tests/test_router_prefix_with_template.py
@router.get("/users/{id}") def read_user(segment: str, id: str): return {"segment": segment, "id": id} app.include_router(router, prefix="/{segment}") client = TestClient(app) def test_get(): response = client.get("/seg/users/foo") assert response.status_code == 200, response.text
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Wed Apr 08 04:37:38 UTC 2020 - 484 bytes - Viewed (0) -
tests/test_tutorial/test_dependencies/test_tutorial008d_an_py39.py
response = client.get("/items/foo") assert response.status_code == 404, response.text assert response.json() == {"detail": "Item not found, there's only a plumbus here"} @needs_py39 def test_get(client: TestClient): response = client.get("/items/plumbus") assert response.status_code == 200, response.text assert response.json() == "plumbus" @needs_py39
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Feb 24 23:06:37 UTC 2024 - 1.3K bytes - Viewed (0)