Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 76 for bear (0.21 sec)

  1. tests/test_tutorial/test_dependencies/test_tutorial004_py310.py

                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,
                {"items": [{"item_name": "Bar"}], "q": "bar"},
            ),
            (
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 5.6K bytes
    - Viewed (0)
  2. tests/test_jsonable_encoder.py

        with pytest.raises(ValidationError):
            ModelWithAlias(foo="Bar")
    
    
    def test_encode_model_with_alias():
        model = ModelWithAlias(Foo="Bar")
        assert jsonable_encoder(model) == {"Foo": "Bar"}
    
    
    def test_encode_model_with_default():
        model = ModelWithDefault(foo="foo", bar="bar")
        assert jsonable_encoder(model) == {"foo": "foo", "bar": "bar", "bla": "bla"}
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 9K bytes
    - Viewed (0)
  3. tests/test_annotated.py

            ("/default?foo=bar", 200, {"foo": "bar"}),
            ("/required?foo=bar", 200, {"foo": "bar"}),
            ("/required", 422, foo_is_missing),
            ("/required?foo=", 422, foo_is_short),
            ("/multiple?foo=bar", 200, {"foo": "bar"}),
            ("/multiple", 422, foo_is_missing),
            ("/multiple?foo=", 422, foo_is_short),
            ("/unrelated?foo=bar", 200, {"foo": "bar"}),
            ("/unrelated", 422, foo_is_missing),
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 10.2K bytes
    - Viewed (0)
  4. tests/main.py

        if query is None:
            return "foo bar"
        return f"foo bar {query}"
    
    
    @app.get("/query/int/default")
    def get_query_type_int_default(query: int = 10):
        return f"foo bar {query}"
    
    
    @app.get("/query/param")
    def get_query_param(query=Query(default=None)):
        if query is None:
            return "foo bar"
        return f"foo bar {query}"
    
    
    @app.get("/query/param-required")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 4.3K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_response_model/test_tutorial006_py310.py

    
    @needs_py310
    def test_read_item_name(client: TestClient):
        response = client.get("/items/bar/name")
        assert response.status_code == 200, response.text
        assert response.json() == {"name": "Bar", "description": "The Bar fighters"}
    
    
    @needs_py310
    def test_read_item_public_data(client: TestClient):
        response = client.get("/items/bar/public")
        assert response.status_code == 200, response.text
        assert response.json() == {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Aug 04 20:47:07 GMT 2023
    - 6.2K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_body_multiple_params/test_tutorial001_py310.py

                "description": None,
                "tax": None,
            },
            "q": "bar",
        }
    
    
    @needs_py310
    def test_post_no_body_q_bar(client: TestClient):
        response = client.put("/items/5?q=bar", json=None)
        assert response.status_code == 200
        assert response.json() == {"item_id": 5, "q": "bar"}
    
    
    @needs_py310
    def test_post_no_body(client: TestClient):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.6K bytes
    - Viewed (0)
  7. docs_src/response_model/tutorial005.py

    
    class Item(BaseModel):
        name: str
        description: Union[str, None] = None
        price: float
        tax: float = 10.5
    
    
    items = {
        "foo": {"name": "Foo", "price": 50.2},
        "bar": {"name": "Bar", "description": "The Bar fighters", "price": 62, "tax": 20.2},
        "baz": {
            "name": "Baz",
            "description": "There goes my baz",
            "price": 50.2,
            "tax": 10.5,
        },
    }
    
    
    @app.get(
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat May 14 11:59:59 GMT 2022
    - 848 bytes
    - Viewed (0)
  8. docs_src/response_model/tutorial006_py310.py

    
    class Item(BaseModel):
        name: str
        description: str | None = None
        price: float
        tax: float = 10.5
    
    
    items = {
        "foo": {"name": "Foo", "price": 50.2},
        "bar": {"name": "Bar", "description": "The Bar fighters", "price": 62, "tax": 20.2},
        "baz": {
            "name": "Baz",
            "description": "There goes my baz",
            "price": 50.2,
            "tax": 10.5,
        },
    }
    
    
    @app.get(
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 816 bytes
    - Viewed (0)
  9. docs_src/app_testing/app_b_py310/main.py

    from fastapi import FastAPI, Header, HTTPException
    from pydantic import BaseModel
    
    fake_secret_token = "coneofsilence"
    
    fake_db = {
        "foo": {"id": "foo", "title": "Foo", "description": "There goes my hero"},
        "bar": {"id": "bar", "title": "Bar", "description": "The bartenders"},
    }
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        id: str
        title: str
        description: str | None = None
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Jan 09 14:44:08 GMT 2024
    - 1.1K bytes
    - Viewed (0)
  10. docs_src/app_testing/app_b_an/main.py

    from pydantic import BaseModel
    from typing_extensions import Annotated
    
    fake_secret_token = "coneofsilence"
    
    fake_db = {
        "foo": {"id": "foo", "title": "Foo", "description": "There goes my hero"},
        "bar": {"id": "bar", "title": "Bar", "description": "The bartenders"},
    }
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        id: str
        title: str
        description: Union[str, None] = None
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 1.2K bytes
    - Viewed (0)
Back to top