- Sort Score
- Result 10 results
- Languages All
Results 31 - 40 of 1,383 for Items (0.04 sec)
-
docs_src/app_testing/tutorial003.py
app = FastAPI() items = {} @app.on_event("startup") async def startup_event(): items["foo"] = {"name": "Fighters"} items["bar"] = {"name": "Tenders"} @app.get("/items/{item_id}") async def read_items(item_id: str): return items[item_id] def test_read_items(): with TestClient(app) as client: response = client.get("/items/foo")
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Mar 26 19:09:53 UTC 2020 - 528 bytes - Viewed (0) -
tests/test_tutorial/test_body/test_tutorial001.py
def test_body_float(client: TestClient): response = client.post("/items/", json={"name": "Foo", "price": 50.5}) assert response.status_code == 200 assert response.json() == { "name": "Foo", "price": 50.5, "description": None, "tax": None, } def test_post_with_str_float(client: TestClient): response = client.post("/items/", json={"name": "Foo", "price": "50.5"})
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 19:40:57 UTC 2024 - 14.7K bytes - Viewed (0) -
tests/test_tutorial/test_body/test_tutorial001_py310.py
response = client.post("/items/", json={"name": "Foo", "price": 50.5}) assert response.status_code == 200 assert response.json() == { "name": "Foo", "price": 50.5, "description": None, "tax": None, } @needs_py310 def test_post_with_str_float(client: TestClient): response = client.post("/items/", json={"name": "Foo", "price": "50.5"})
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 19:40:57 UTC 2024 - 15K bytes - Viewed (1) -
istioctl/pkg/tag/tag_test.go
webhooksAfter, _ := client.AdmissionregistrationV1().MutatingWebhookConfigurations().List(context.Background(), metav1.ListOptions{}) if len(webhooksAfter.Items) != len(tc.webhooksAfter.Items) { t.Fatalf("expected %d after running, got %d", len(tc.webhooksAfter.Items), len(webhooksAfter.Items)) } }) } } func TestSetTagErrors(t *testing.T) { tcs := []struct { name string tag string
Registered: Wed Nov 06 22:53:10 UTC 2024 - Last Modified: Wed Oct 09 16:05:45 UTC 2024 - 8.5K bytes - Viewed (0) -
tests/test_tutorial/test_header_params/test_tutorial002_an_py39.py
[ ("/items", None, 200, {"strange_header": None}), ("/items", {"X-Header": "notvalid"}, 200, {"strange_header": None}), ( "/items", {"strange_header": "FastAPI test"}, 200, {"strange_header": "FastAPI test"}, ), ( "/items", {"strange-header": "Not really underscore"},
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jul 07 17:12:13 UTC 2023 - 4.2K bytes - Viewed (0) -
tests/test_tutorial/test_query_params_str_validations/test_tutorial011_an_py39.py
return client @needs_py39 def test_multi_query_values(client: TestClient): url = "/items/?q=foo&q=bar" response = client.get(url) assert response.status_code == 200, response.text assert response.json() == {"q": ["foo", "bar"]} @needs_py39 def test_query_no_values(client: TestClient): url = "/items/" response = client.get(url) assert response.status_code == 200, response.text
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jul 07 17:12:13 UTC 2023 - 4.1K bytes - Viewed (0) -
tests/test_tutorial/test_body_updates/test_tutorial001_py39.py
def test_get(client: TestClient): response = client.get("/items/baz") assert response.status_code == 200, response.text assert response.json() == { "name": "Baz", "description": None, "price": 50.2, "tax": 10.5, "tags": [], } @needs_py39 def test_put(client: TestClient): response = client.put( "/items/bar", json={"name": "Barz", "price": 3, "description": None}
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Sep 28 04:14:40 UTC 2023 - 11.8K bytes - Viewed (0) -
tests/test_tutorial/test_header_params/test_tutorial001.py
client = TestClient(app) @pytest.mark.parametrize( "path,headers,expected_status,expected_response", [ ("/items", None, 200, {"User-Agent": "testclient"}), ("/items", {"X-Header": "notvalid"}, 200, {"User-Agent": "testclient"}), ("/items", {"User-Agent": "FastAPI test"}, 200, {"User-Agent": "FastAPI test"}), ], ) def test(path, headers, expected_status, expected_response):
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jul 07 17:12:13 UTC 2023 - 3.8K bytes - Viewed (0) -
tests/test_tutorial/test_query_params_str_validations/test_tutorial012_an_py39.py
return client @needs_py39 def test_default_query_values(client: TestClient): url = "/items/" response = client.get(url) assert response.status_code == 200, response.text assert response.json() == {"q": ["foo", "bar"]} @needs_py39 def test_multi_query_values(client: TestClient): url = "/items/?q=baz&q=foobar" response = client.get(url) 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 - 3.6K bytes - Viewed (0) -
tests/test_tutorial/test_dependencies/test_tutorial006_an_py39.py
@needs_py39 def test_get_invalid_one_header(client: TestClient): response = client.get("/items/", headers={"X-Token": "invalid"}) assert response.status_code == 400, response.text assert response.json() == {"detail": "X-Token header invalid"} @needs_py39 def test_get_invalid_second_header(client: TestClient): response = client.get( "/items/", headers={"X-Token": "fake-super-secret-token", "X-Key": "invalid"} )
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 19:40:57 UTC 2024 - 5.3K bytes - Viewed (0)