Search Options

Results per page
Sort
Preferred Languages
Advance

Results 131 - 140 of 1,205 for itens (0.02 sec)

  1. tests/test_tutorial/test_query_params/test_tutorial002.py

        client = TestClient(mod.app)
        return client
    
    
    @pytest.mark.parametrize(
        ("path", "expected_json"),
        [
            (
                "/items/foo",
                {"item_id": "foo"},
            ),
            (
                "/items/bar?q=somequery",
                {"item_id": "bar", "q": "somequery"},
            ),
        ],
    )
    def test_read_user_item(client: TestClient, path, expected_json):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 4.2K bytes
    - Viewed (0)
  2. docs_src/metadata/tutorial001_1_py39.py

    from fastapi import FastAPI
    
    description = """
    ChimichangApp API helps you do awesome stuff. ๐Ÿš€
    
    ## Items
    
    You can **read items**.
    
    ## Users
    
    You will be able to:
    
    * **Create users** (_not implemented_).
    * **Read users** (_not implemented_).
    """
    
    app = FastAPI(
        title="ChimichangApp",
        description=description,
        summary="Deadpool's favorite app. Nuff said.",
        version="0.0.1",
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 767 bytes
    - Viewed (0)
  3. tests/test_security_oauth2_authorization_code_bearer_scopes_openapi.py

        return {"message": "Admin Access"}
    
    
    router = APIRouter(dependencies=[Security(oauth2_scheme, scopes=["read"])])
    
    
    @router.get("/items/")
    async def read_items(token: Optional[str] = Depends(oauth2_scheme)):
        return {"token": token}
    
    
    @router.post("/items/")
    async def create_item(
        token: Optional[str] = Security(oauth2_scheme, scopes=["read", "write"]),
    ):
        return {"token": token}
    
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 21:25:59 UTC 2025
    - 6.6K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_dependencies/test_tutorial002_tutorial003_tutorial004.py

                },
            ),
            (
                "/items?q=foo&skip=1",
                200,
                {"items": [{"item_name": "Bar"}, {"item_name": "Baz"}], "q": "foo"},
            ),
            (
                "/items?q=bar&limit=2",
                200,
                {"items": [{"item_name": "Foo"}, {"item_name": "Bar"}], "q": "bar"},
            ),
            (
                "/items?q=bar&skip=1&limit=1",
                200,
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 6K bytes
    - Viewed (0)
  5. docs/ja/docs/tutorial/query-params.md

    ใ“ใฎๅ ดๅˆใ€ไปฅไธ‹ใซใ‚ขใ‚ฏใ‚ปใ‚นใ™ใ‚‹ใจ:
    
    ```
    http://127.0.0.1:8000/items/foo?short=1
    ```
    
    ใ‚‚ใ—ใใฏใ€
    
    ```
    http://127.0.0.1:8000/items/foo?short=True
    ```
    
    ใ‚‚ใ—ใใฏใ€
    
    ```
    http://127.0.0.1:8000/items/foo?short=true
    ```
    
    ใ‚‚ใ—ใใฏใ€
    
    ```
    http://127.0.0.1:8000/items/foo?short=on
    ```
    
    ใ‚‚ใ—ใใฏใ€
    
    ```
    http://127.0.0.1:8000/items/foo?short=yes
    ```
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 18 02:25:44 UTC 2024
    - 5.4K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_additional_responses/test_tutorial002.py

    
    def test_path_operation(client: TestClient):
        response = client.get("/items/foo")
        assert response.status_code == 200, response.text
        assert response.json() == {"id": "foo", "value": "there goes my hero"}
    
    
    def test_path_operation_img(client: TestClient):
        shutil.copy("./docs/en/docs/img/favicon.png", "./image.png")
        response = client.get("/items/foo?img=1")
        assert response.status_code == 200, response.text
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 4.7K bytes
    - Viewed (0)
  7. tests/test_validation_error_context.py

        raise exc
    
    
    @app.get("/users/{user_id}")
    def get_user(user_id: int):
        return {"user_id": user_id}  # pragma: no cover
    
    
    @app.get("/items/", response_model=Item)
    def get_item():
        return {"name": "Widget"}
    
    
    @sub_app.get("/items/", response_model=Item)
    def get_sub_item():
        return {"name": "Widget"}  # pragma: no cover
    
    
    @app.websocket("/ws/{item_id}")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 06 12:21:57 UTC 2025
    - 4.7K bytes
    - Viewed (0)
  8. tests/test_invalid_sequence_param.py

            class Item(BaseModel):
                title: str
    
            @app.get("/items/")
            def read_items(q: list[Item] = Query(default=None)):
                pass  # pragma: no cover
    
    
    def test_invalid_tuple():
        with pytest.raises(AssertionError):
            app = FastAPI()
    
            class Item(BaseModel):
                title: str
    
            @app.get("/items/")
            def read_items(q: tuple[Item, Item] = Query(default=None)):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 21:25:59 UTC 2025
    - 1.2K bytes
    - Viewed (0)
  9. tests/test_serialize_response_model.py

        price: Optional[float] = None
        owner_ids: Optional[list[int]] = None
    
    
    @app.get("/items/valid", response_model=Item)
    def get_valid():
        return Item(aliased_name="valid", price=1.0)
    
    
    @app.get("/items/coerce", response_model=Item)
    def get_coerce():
        return Item(aliased_name="coerce", price="1.0")
    
    
    @app.get("/items/validlist", response_model=list[Item])
    def get_validlist():
        return [
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 21:25:59 UTC 2025
    - 4.2K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_dataclasses/test_tutorial001.py

    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,
            "description": None,
            "tax": None,
        }
    
    
    def test_post_invalid_item(client: TestClient):
        response = client.post("/items/", json={"name": "Foo", "price": "invalid price"})
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 4.6K bytes
    - Viewed (0)
Back to top