Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 167 for path1a (0.04 sec)

  1. tests/test_tutorial/test_request_forms_and_files/test_tutorial001.py

                },
            ]
        }
    
    
    def test_post_files_and_token(tmp_path, app: FastAPI):
        patha = tmp_path / "test.txt"
        pathb = tmp_path / "testb.txt"
        patha.write_text("<file content>")
        pathb.write_text("<file b content>")
    
        client = TestClient(app)
        with patha.open("rb") as filea, pathb.open("rb") as fileb:
            response = client.post(
                "/files/",
                data={"token": "foo"},
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 7.3K bytes
    - Viewed (0)
  2. docs/de/docs/advanced/path-operation-advanced-configuration.md

    {
        "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",
                            "content": {
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 24 10:28:19 UTC 2025
    - 8.3K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_request_files/test_tutorial002.py

                }
            ]
        }
    
    
    def test_post_files(tmp_path, app: FastAPI):
        path = tmp_path / "test.txt"
        path.write_bytes(b"<file content>")
        path2 = tmp_path / "test2.txt"
        path2.write_bytes(b"<file content2>")
    
        client = TestClient(app)
        with path.open("rb") as file, path2.open("rb") as file2:
            response = client.post(
                "/files/",
                files=(
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 8.2K bytes
    - Viewed (0)
  4. tests/test_request_params/test_header/test_optional_str.py

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

    async def read_model_required_str(p: Annotated[HeaderModelRequiredStr, Header()]):
        return {"p": p.p}
    
    
    @pytest.mark.parametrize(
        "path",
        ["/required-str", "/model-required-str"],
    )
    def test_required_str_schema(path: str):
        assert app.openapi()["paths"][path]["get"]["parameters"] == [
            {
                "required": True,
                "schema": {"title": "P", "type": "string"},
                "name": "p",
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 10K bytes
    - Viewed (0)
  6. tests/test_request_params/test_query/test_optional_list.py

        p: Annotated[QueryModelOptionalListStr, Query()],
    ):
        return {"p": p.p}
    
    
    @pytest.mark.parametrize(
        "path",
        ["/optional-list-str", "/model-optional-list-str"],
    )
    def test_optional_list_str_schema(path: str):
        assert app.openapi()["paths"][path]["get"]["parameters"] == [
            {
                "required": False,
                "schema": {
                    "anyOf": [
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 9.1K bytes
    - Viewed (0)
  7. tests/test_request_params/test_query/test_required_str.py

    async def read_model_required_str(p: Annotated[QueryModelRequiredStr, Query()]):
        return {"p": p.p}
    
    
    @pytest.mark.parametrize(
        "path",
        ["/required-str", "/model-required-str"],
    )
    def test_required_str_schema(path: str):
        assert app.openapi()["paths"][path]["get"]["parameters"] == [
            {
                "required": True,
                "schema": {"title": "P", "type": "string"},
                "name": "p",
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 9.9K bytes
    - Viewed (0)
  8. tests/test_request_params/test_header/test_list.py

    def read_model_required_list_str(p: Annotated[HeaderModelRequiredListStr, Header()]):
        return {"p": p.p}
    
    
    @pytest.mark.parametrize(
        "path",
        ["/required-list-str", "/model-required-list-str"],
    )
    def test_required_list_str_schema(path: str):
        assert app.openapi()["paths"][path]["get"]["parameters"] == [
            {
                "required": True,
                "schema": {
                    "title": "P",
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:31:34 UTC 2025
    - 11K bytes
    - Viewed (0)
  9. scripts/translate.py

        return yaml.safe_load(Path("docs/language_names.yml").read_text(encoding="utf-8"))
    
    
    def generate_lang_path(*, lang: str, path: Path) -> Path:
        en_docs_path = Path("docs/en/docs")
        assert str(path).startswith(str(en_docs_path)), (
            f"Path must be inside {en_docs_path}"
        )
        lang_docs_path = Path(f"docs/{lang}/docs")
        out_path = Path(str(path).replace(str(en_docs_path), str(lang_docs_path)))
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 19:05:53 UTC 2025
    - 34.1K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_static_files/test_tutorial001.py

    import os
    from pathlib import Path
    
    import pytest
    from fastapi.testclient import TestClient
    
    
    @pytest.fixture(scope="module")
    def client():
        static_dir: Path = Path(os.getcwd()) / "static"
        static_dir.mkdir(exist_ok=True)
        sample_file = static_dir / "sample.txt"
        sample_file.write_text("This is a sample static file.")
        from docs_src.static_files.tutorial001_py39 import app
    
        with TestClient(app) as client:
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 1.1K bytes
    - Viewed (0)
Back to top