- Sort Score
- Result 10 results
- Languages All
Results 391 - 400 of 726 for item_e (0.16 sec)
-
tests/test_tutorial/test_query_params_str_validations/test_tutorial015.py
return client def test_get_random_item(client: TestClient): response = client.get("/items") assert response.status_code == 200, response.text assert response.json() == {"id": IsStr(), "name": IsStr()} def test_get_item(client: TestClient): response = client.get("/items?id=isbn-9781529046137") assert response.status_code == 200, response.text assert response.json() == {
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 20 15:55:38 UTC 2025 - 5K bytes - Viewed (0) -
tests/test_tutorial/test_extra_models/test_tutorial004.py
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 2.2K bytes - Viewed (0) -
docs/zh/docs/tutorial/path-params-numeric-validations.md
但是你仍然需要使用 `Path` 来声明路径参数 `item_id`。 如果你将带有「默认值」的参数放在没有「默认值」的参数之前,Python 将会报错。 但是你可以对其重新排序,并将不带默认值的值(查询参数 `q`)放到最前面。 对 **FastAPI** 来说这无关紧要。它将通过参数的名称、类型和默认值声明(`Query`、`Path` 等)来检测参数,而不在乎参数的顺序。 因此,你可以将函数声明为: {* ../../docs_src/path_params_numeric_validations/tutorial002.py hl[7] *} ## 按需对参数排序的技巧 如果你想不使用 `Query` 声明没有默认值的查询参数 `q`,同时使用 `Path` 声明路径参数 `item_id`,并使它们的顺序与上面不同,Python 对此有一些特殊的语法。Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Mon Nov 18 02:25:44 UTC 2024 - 4.6K bytes - Viewed (0) -
tests/test_tutorial/test_cookie_param_models/test_tutorial001.py
response = c.get("/items/") assert response.status_code == 200 assert response.json() == { "session_id": "123", "fatebook_tracker": "456", "googall_tracker": "789", } def test_cookie_param_model_defaults(client: TestClient): with client as c: c.cookies.set("session_id", "123") response = c.get("/items/") assert response.status_code == 200
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 6K bytes - Viewed (0) -
tests/test_multi_body_errors.py
from pydantic import BaseModel, condecimal app = FastAPI() class Item(BaseModel): name: str age: condecimal(gt=Decimal(0.0)) # type: ignore @app.post("/items/") def save_item_no_body(item: list[Item]): return {"item": item} client = TestClient(app) def test_put_correct_body(): response = client.post("/items/", json=[{"name": "Foo", "age": 5}])
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 6.1K bytes - Viewed (0) -
docs_src/app_testing/app_b_an_py310/test_main.py
def test_read_nonexistent_item(): response = client.get("/items/baz", headers={"X-Token": "coneofsilence"}) assert response.status_code == 404 assert response.json() == {"detail": "Item not found"} def test_create_item(): response = client.post( "/items/", headers={"X-Token": "coneofsilence"},
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Thu Aug 15 22:31:16 UTC 2024 - 1.8K bytes - Viewed (0) -
docs_src/app_testing/app_b_py39/test_main.py
def test_read_nonexistent_item(): response = client.get("/items/baz", headers={"X-Token": "coneofsilence"}) assert response.status_code == 404 assert response.json() == {"detail": "Item not found"} def test_create_item(): response = client.post( "/items/", headers={"X-Token": "coneofsilence"},
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 1.8K bytes - Viewed (0) -
internal/lru/lru.go
c.mu.Lock() defer c.mu.Unlock() _, ok = c.items[key] return ok } // Peek returns the key value (or undefined if not found) without updating // the "recently used"-ness of the key. func (c *LRU[K, V]) Peek(key K) (value V, ok bool) { c.mu.Lock() defer c.mu.Unlock() var ent *Entry[K, V] if ent, ok = c.items[key]; ok { // Expired item check if time.Now().After(ent.ExpiresAt) {
Registered: Sun Dec 28 09:35:17 UTC 2025 - Last Modified: Fri Apr 25 08:22:26 UTC 2025 - 12.5K bytes - Viewed (0) -
scripts/mkdocs_hooks.py
) ) def resolve_files(*, items: list[Any], files: Files, config: MkDocsConfig) -> None: for item in items: if isinstance(item, str): resolve_file(item=item, files=files, config=config) elif isinstance(item, dict): assert len(item) == 1 values = list(item.values()) if not values: continueRegistered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 21:25:59 UTC 2025 - 5.6K bytes - Viewed (0) -
docs/ko/docs/tutorial/path-params-numeric-validations.md
## 경로 임포트 먼저 `fastapi`에서 `Path`를 임포트합니다: {* ../../docs_src/path_params_numeric_validations/tutorial001.py hl[3] *} ## 메타데이터 선언 `Query`에 동일한 매개변수를 선언할 수 있습니다. 예를 들어, `title` 메타데이터 값을 경로 매개변수 `item_id`에 선언하려면 다음과 같이 입력할 수 있습니다: {* ../../docs_src/path_params_numeric_validations/tutorial001.py hl[10] *} /// note | 참고 경로 매개변수는 경로의 일부여야 하므로 언제나 필수적입니다. 즉, `...`로 선언해서 필수임을 나타내는게 좋습니다.Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Mon Nov 18 02:25:44 UTC 2024 - 5.4K bytes - Viewed (0)