- Sort Score
- Result 10 results
- Languages All
Results 1 - 9 of 9 for test_post_items (0.06 sec)
-
tests/test_tutorial/test_path_operation_configurations/test_tutorial001.py
) def get_client(request: pytest.FixtureRequest) -> TestClient: mod = importlib.import_module( f"docs_src.path_operation_configuration.{request.param}" ) return TestClient(mod.app) def test_post_items(client: TestClient): response = client.post( "/items/", json={ "name": "Foo", "description": "Item description", "price": 42.0, "tax": 3.2,
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Dec 26 10:43:02 UTC 2025 - 6.2K bytes - Viewed (0) -
tests/test_tutorial/test_generate_clients/test_tutorial001.py
], ) def get_client(request: pytest.FixtureRequest): mod = importlib.import_module(f"docs_src.generate_clients.{request.param}") client = TestClient(mod.app) return client def test_post_items(client: TestClient): response = client.post("/items/", json={"name": "Foo", "price": 5}) assert response.status_code == 200, response.text assert response.json() == {"message": "item received"}
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Dec 26 10:43:02 UTC 2025 - 5.2K bytes - Viewed (0) -
tests/test_tutorial/test_generate_clients/test_tutorial003.py
from fastapi.testclient import TestClient from docs_src.generate_clients.tutorial003_py39 import app client = TestClient(app) def test_post_items(): response = client.post("/items/", json={"name": "Foo", "price": 5}) assert response.status_code == 200, response.text assert response.json() == {"message": "Item received"} def test_post_users(): response = client.post(
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 7.1K bytes - Viewed (0) -
tests/test_tutorial/test_path_operation_configurations/test_tutorial002.py
) def get_client(request: pytest.FixtureRequest) -> TestClient: mod = importlib.import_module( f"docs_src.path_operation_configuration.{request.param}" ) return TestClient(mod.app) def test_post_items(client: TestClient): response = client.post( "/items/", json={ "name": "Foo", "description": "Item description", "price": 42.0, "tax": 3.2,
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Dec 26 10:43:02 UTC 2025 - 7.6K bytes - Viewed (0) -
tests/test_tutorial/test_generate_clients/test_tutorial002.py
from fastapi.testclient import TestClient from docs_src.generate_clients.tutorial002_py39 import app client = TestClient(app) def test_post_items(): response = client.post("/items/", json={"name": "Foo", "price": 5}) assert response.status_code == 200, response.text assert response.json() == {"message": "Item received"} def test_post_users(): response = client.post(
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Dec 26 10:43:02 UTC 2025 - 7.1K bytes - Viewed (0) -
tests/test_tutorial/test_path_operation_configurations/test_tutorial003_tutorial004.py
@pytest.fixture(name="client") def get_client(mod_name: str) -> TestClient: mod = importlib.import_module(f"docs_src.path_operation_configuration.{mod_name}") return TestClient(mod.app) def test_post_items(client: TestClient): response = client.post( "/items/", json={ "name": "Foo", "description": "Item description", "price": 42.0, "tax": 3.2,
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Fri Dec 26 10:43:02 UTC 2025 - 7K bytes - Viewed (0) -
tests/test_union_inherited_body.py
response = client.post("/items/", json={"name": "Foo", "age": 5}) assert response.status_code == 200, response.text assert response.json() == {"item": {"name": "Foo", "age": 5}} def test_post_item(): response = client.post("/items/", json={"name": "Foo"}) assert response.status_code == 200, response.text assert response.json() == {"item": {"name": "Foo"}} def test_openapi_schema():
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 4.6K bytes - Viewed (0) -
tests/test_union_body.py
def test_post_other_item(): response = client.post("/items/", json={"price": 100}) assert response.status_code == 200, response.text assert response.json() == {"item": {"price": 100}} def test_post_item(): response = client.post("/items/", json={"name": "Foo"}) assert response.status_code == 200, response.text assert response.json() == {"item": {"name": "Foo"}} def test_openapi_schema():
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 4.3K bytes - Viewed (0) -
tests/test_tutorial/test_dataclasses/test_tutorial001.py
def get_client(request: pytest.FixtureRequest): mod = importlib.import_module(f"docs_src.dataclasses_.{request.param}") client = TestClient(mod.app) client.headers.clear() return client def test_post_item(client: TestClient): response = client.post("/items/", json={"name": "Foo", "price": 3}) assert response.status_code == 200 assert response.json() == { "name": "Foo", "price": 3,
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 4.6K bytes - Viewed (0)