Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 118 for fluent (0.03 sec)

  1. tests/test_tutorial/test_body/test_tutorial001.py

    
    @pytest.fixture(
        name="client",
        params=[
            "tutorial001_py39",
            pytest.param("tutorial001_py310", marks=needs_py310),
        ],
    )
    def get_client(request: pytest.FixtureRequest):
        mod = importlib.import_module(f"docs_src.body.{request.param}")
    
        client = TestClient(mod.app)
        return client
    
    
    def test_body_float(client: TestClient):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 10.6K bytes
    - Viewed (0)
  2. tests/test_request_params/test_cookie/test_optional_str.py

    def test_optional_str_missing(path: str):
        client = TestClient(app)
        response = client.get(path)
        assert response.status_code == 200
        assert response.json() == {"p": None}
    
    
    @pytest.mark.parametrize(
        "path",
        ["/optional-str", "/model-optional-str"],
    )
    def test_optional_str(path: str):
        client = TestClient(app)
        client.cookies.set("p", "hello")
        response = client.get(path)
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 8.4K bytes
    - Viewed (0)
  3. tests/test_request_params/test_header/test_optional_list.py

    def test_optional_list_str_missing(path: str):
        client = TestClient(app)
        response = client.get(path)
        assert response.status_code == 200, response.text
        assert response.json() == {"p": None}
    
    
    @pytest.mark.parametrize(
        "path",
        ["/optional-list-str", "/model-optional-list-str"],
    )
    def test_optional_list_str(path: str):
        client = TestClient(app)
        response = client.get(path, headers=[("p", "hello"), ("p", "world")])
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 9.3K bytes
    - Viewed (0)
  4. tests/test_request_params/test_query/test_list.py

            }
        ]
    
    
    @pytest.mark.parametrize(
        "path",
        ["/required-list-str", "/model-required-list-str"],
    )
    def test_required_list_str_missing(path: str):
        client = TestClient(app)
        response = client.get(path)
        assert response.status_code == 422
        assert response.json() == {
            "detail": [
                {
                    "type": "missing",
                    "loc": ["query", "p"],
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:31:34 UTC 2025
    - 10.9K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_request_files/test_tutorial001_02.py

        client = TestClient(mod.app)
        return client
    
    
    def test_post_form_no_body(client: TestClient):
        response = client.post("/files/")
        assert response.status_code == 200, response.text
        assert response.json() == {"message": "No file sent"}
    
    
    def test_post_uploadfile_no_body(client: TestClient):
        response = client.post("/uploadfile/")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 7.4K bytes
    - Viewed (0)
  6. tests/test_regex_deprecated_params.py

                    return "Hello World"
    
        client = TestClient(app)
        return client
    
    
    @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()
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 4.6K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_custom_request_and_route/test_tutorial002.py

        mod = importlib.import_module(f"docs_src.custom_request_and_route.{request.param}")
    
        client = TestClient(mod.app)
        return client
    
    
    def test_endpoint_works(client: TestClient):
        response = client.post("/", json=[1, 2, 3])
        assert response.json() == 6
    
    
    def test_exception_handler_body_access(client: TestClient):
        response = client.post("/", json={"numbers": [1, 2, 3]})
        assert response.json() == {
            "detail": {
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 1.3K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_body_multiple_params/test_tutorial003.py

        client = TestClient(mod.app)
        return client
    
    
    def test_post_body_valid(client: TestClient):
        response = client.put(
            "/items/5",
            json={
                "importance": 2,
                "item": {"name": "Foo", "price": 50.5},
                "user": {"username": "Dave"},
            },
        )
        assert response.status_code == 200
        assert response.json() == {
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 7.4K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_security/test_tutorial003.py

        client = TestClient(mod.app)
        return client
    
    
    def test_login(client: TestClient):
        response = client.post("/token", data={"username": "johndoe", "password": "secret"})
        assert response.status_code == 200, response.text
        assert response.json() == {"access_token": "johndoe", "token_type": "bearer"}
    
    
    def test_login_incorrect_password(client: TestClient):
        response = client.post(
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 7.7K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_dependencies/test_tutorial012.py

    
    @pytest.fixture(
        name="client",
        params=[
            pytest.param("tutorial012_py39"),
            pytest.param("tutorial012_an_py39"),
        ],
    )
    def get_client(request: pytest.FixtureRequest):
        mod = importlib.import_module(f"docs_src.dependencies.{request.param}")
    
        client = TestClient(mod.app)
        return client
    
    
    def test_get_no_headers_items(client: TestClient):
        response = client.get("/items/")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 7.7K bytes
    - Viewed (0)
Back to top