Search Options

Results per page
Sort
Preferred Languages
Advance

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

  1. 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)
  2. 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)
  3. 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)
  4. tests/test_tutorial/test_path_params/test_tutorial001.py

    @pytest.mark.parametrize(
        ("item_id", "expected_response"),
        [
            (1, {"item_id": "1"}),
            ("alice", {"item_id": "alice"}),
        ],
    )
    def test_get_items(item_id, expected_response):
        response = client.get(f"/items/{item_id}")
        assert response.status_code == 200, response.text
        assert response.json() == expected_response
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 3.9K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_path_operation_configurations/test_tutorial005.py

            f"docs_src.path_operation_configuration.{request.param}"
        )
    
        client = TestClient(mod.app)
        return client
    
    
    def test_query_params_str_validations(client: TestClient):
        response = client.post("/items/", json={"name": "Foo", "price": 42})
        assert response.status_code == 200, response.text
        assert response.json() == {
            "name": "Foo",
            "price": 42,
            "description": None,
            "tax": None,
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 20 15:55:38 UTC 2025
    - 5K bytes
    - Viewed (0)
  6. docs_src/app_testing/tutorial004_py39.py

    from fastapi.testclient import TestClient
    
    items = {}
    
    
    @asynccontextmanager
    async def lifespan(app: FastAPI):
        items["foo"] = {"name": "Fighters"}
        items["bar"] = {"name": "Tenders"}
        yield
        # clean up items
        items.clear()
    
    
    app = FastAPI(lifespan=lifespan)
    
    
    @app.get("/items/{item_id}")
    async def read_items(item_id: str):
        return items[item_id]
    
    
    def test_read_items():
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 1.2K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_response_status_code/test_tutorial001_tutorial002.py

        mod = importlib.import_module(f"docs_src.response_status_code.{request.param}")
    
        client = TestClient(mod.app)
        return client
    
    
    def test_create_item(client: TestClient):
        response = client.post("/items/", params={"name": "Test Item"})
        assert response.status_code == 201, response.text
        assert response.json() == {"name": "Test Item"}
    
    
    def test_openapi_schema(client: TestClient):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 3.3K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_path_operation_configurations/test_tutorial003_tutorial004.py

        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,
                "tags": ["bar", "baz"],
            },
        )
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 7K bytes
    - Viewed (0)
  9. 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)
  10. tests/test_tutorial/test_metadata/test_tutorial003.py

            "openapi": "3.1.0",
            "info": {
                "title": "FastAPI",
                "version": "0.1.0",
            },
            "paths": {
                "/items/": {
                    "get": {
                        "summary": "Read Items",
                        "operationId": "read_items_items__get",
                        "responses": {
                            "200": {
                                "description": "Successful Response",
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 1.5K bytes
    - Viewed (0)
Back to top