Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 1,383 for Items (0.08 sec)

  1. internal/store/batch_test.go

    	}
    	if key.ItemCount != int(limit) {
    		t.Fatalf("expected key.ItemCount=%d; but got %v", limit, key.ItemCount)
    	}
    	items, err := store.GetMultiple(key)
    	if err != nil {
    		t.Fatalf("unable to read key %v; %v", key.String(), err)
    	}
    	if len(items) != int(limit) {
    		t.Fatalf("expected len(items)=%d; but got %v", limit, len(items))
    	}
    }
    
    func TestBatchCommitOnExit(t *testing.T) {
    	defer func() {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Fri Sep 06 23:06:30 UTC 2024
    - 5.6K bytes
    - Viewed (0)
  2. tests/test_regex_deprecated_params.py

    @needs_py310
    def test_query_params_str_validations_no_query():
        client = get_client()
        response = client.get("/items/")
        assert response.status_code == 200
        assert response.json() == "Hello World"
    
    
    @needs_py310
    def test_query_params_str_validations_q_fixedquery():
        client = get_client()
        response = client.get("/items/", params={"q": "fixedquery"})
        assert response.status_code == 200
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 5.5K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_bigger_applications/test_main_an.py

                                },
                            },
                        },
                    }
                },
                "/items/": {
                    "get": {
                        "tags": ["items"],
                        "summary": "Read Items",
                        "operationId": "read_items_items__get",
                        "parameters": [
                            {
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 24.6K bytes
    - Viewed (0)
  4. docs/zh/docs/tutorial/bigger-applications.md

    ///
    
    ## 其他使用 `APIRouter` 的模块
    
    假设你在位于 `app/routers/items.py` 的模块中还有专门用于处理应用程序中「项目」的端点。
    
    你具有以下*路径操作*:
    
    * `/items/`
    * `/items/{item_id}`
    
    这和 `app/routers/users.py` 的结构完全相同。
    
    但是我们想变得更聪明并简化一些代码。
    
    我们知道此模块中的所有*路径操作*都有相同的:
    
    * 路径 `prefix`:`/items`。
    * `tags`:(仅有一个 `items` 标签)。
    * 额外的 `responses`。
    * `dependencies`:它们都需要我们创建的 `X-Token` 依赖项。
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 18.4K bytes
    - Viewed (0)
  5. tests/test_security_oauth2_password_bearer_optional_description.py

        auto_error=False,
    )
    
    
    @app.get("/items/")
    async def read_items(token: Optional[str] = Security(oauth2_scheme)):
        if token is None:
            return {"msg": "Create an account first"}
        return {"token": token}
    
    
    client = TestClient(app)
    
    
    def test_no_token():
        response = client.get("/items")
        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
    - 2.2K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_query_param_models/test_tutorial002.py

        response = client.get("/items/")
        assert response.status_code == 200
        assert response.json() == {
            "limit": 100,
            "offset": 0,
            "order_by": "created_at",
            "tags": [],
        }
    
    
    def test_query_param_model_invalid(client: TestClient):
        response = client.get(
            "/items/",
            params={
                "limit": 150,
                "offset": -1,
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Sep 17 18:54:10 UTC 2024
    - 10.4K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_header_params/test_tutorial001_an_py310.py

        return client
    
    
    @needs_py310
    @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"}),
        ],
    )
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 4K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_dependencies/test_tutorial001.py

    client = TestClient(app)
    
    
    @pytest.mark.parametrize(
        "path,expected_status,expected_response",
        [
            ("/items", 200, {"q": None, "skip": 0, "limit": 100}),
            ("/items?q=foo", 200, {"q": "foo", "skip": 0, "limit": 100}),
            ("/items?q=foo&skip=5", 200, {"q": "foo", "skip": 5, "limit": 100}),
            ("/items?q=foo&skip=5&limit=30", 200, {"q": "foo", "skip": 5, "limit": 30}),
            ("/users", 200, {"q": None, "skip": 0, "limit": 100}),
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 7K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_query_params_str_validations/test_tutorial014_an.py

    client = TestClient(app)
    
    
    def test_hidden_query():
        response = client.get("/items?hidden_query=somevalue")
        assert response.status_code == 200, response.text
        assert response.json() == {"hidden_query": "somevalue"}
    
    
    def test_no_hidden_query():
        response = client.get("/items")
        assert response.status_code == 200, response.text
        assert response.json() == {"hidden_query": "Not found"}
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 2.9K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_query_params_str_validations/test_tutorial010.py

    
    def test_query_params_str_validations_no_query(client: TestClient):
        response = client.get("/items/")
        assert response.status_code == 200
        assert response.json() == {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
    
    
    def test_query_params_str_validations_item_query_fixedquery(client: TestClient):
        response = client.get("/items/", params={"item-query": "fixedquery"})
        assert response.status_code == 200
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 6.2K bytes
    - Viewed (0)
Back to top