Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 264 for Nath (0.32 sec)

  1. tests/main.py

    @app.get("/path/param-lt/{item_id}")
    def get_path_param_lt(item_id: float = Path(lt=3)):
        return item_id
    
    
    @app.get("/path/param-lt0/{item_id}")
    def get_path_param_lt0(item_id: float = Path(lt=0)):
        return item_id
    
    
    @app.get("/path/param-le/{item_id}")
    def get_path_param_le(item_id: float = Path(le=3)):
        return item_id
    
    
    @app.get("/path/param-lt-gt/{item_id}")
    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)
  2. scripts/docs.py

        """
        new_path: Path = Path("docs") / lang
        if new_path.exists():
            typer.echo(f"The language was already created: {lang}")
            raise typer.Abort()
        new_path.mkdir()
        new_config_path: Path = Path(new_path) / mkdocs_name
        new_config_path.write_text("INHERIT: ../en/mkdocs.yml\n", encoding="utf-8")
        new_config_docs_path: Path = new_path / "docs"
        new_config_docs_path.mkdir()
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Mon Jan 22 19:26:14 GMT 2024
    - 10.9K bytes
    - Viewed (1)
  3. tests/test_tutorial/test_custom_response/test_tutorial009.py

    from pathlib import Path
    
    from fastapi.testclient import TestClient
    
    from docs_src.custom_response import tutorial009
    from docs_src.custom_response.tutorial009 import app
    
    client = TestClient(app)
    
    
    def test_get(tmp_path: Path):
        file_path: Path = tmp_path / "large-video-file.mp4"
        tutorial009.some_file_path = str(file_path)
        test_content = b"Fake video bytes"
        file_path.write_bytes(test_content)
        response = client.get("/")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Jul 03 19:51:28 GMT 2021
    - 487 bytes
    - Viewed (0)
  4. tests/test_tutorial/test_custom_response/test_tutorial009b.py

    from pathlib import Path
    
    from fastapi.testclient import TestClient
    
    from docs_src.custom_response import tutorial009b
    from docs_src.custom_response.tutorial009b import app
    
    client = TestClient(app)
    
    
    def test_get(tmp_path: Path):
        file_path: Path = tmp_path / "large-video-file.mp4"
        tutorial009b.some_file_path = str(file_path)
        test_content = b"Fake video bytes"
        file_path.write_bytes(test_content)
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Jul 03 19:51:28 GMT 2021
    - 490 bytes
    - Viewed (0)
  5. fastapi/dependencies/utils.py

        assert callable(
            depends.dependency
        ), "A parameter-less dependency must have a callable dependency"
        return get_sub_dependant(depends=depends, dependency=depends.dependency, path=path)
    
    
    def get_sub_dependant(
        *,
        depends: params.Depends,
        dependency: Callable[..., Any],
        path: str,
        name: Optional[str] = None,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:52:56 GMT 2024
    - 29.5K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_request_files/test_tutorial001_an.py

        path.write_bytes(b"x" * (default_pydantic_max_size + 1))
    
        client = TestClient(app)
        with path.open("rb") as file:
            response = client.post("/files/", files={"file": file})
        assert response.status_code == 200, response.text
        assert response.json() == {"file_size": default_pydantic_max_size + 1}
    
    
    def test_post_upload_file(tmp_path):
        path = tmp_path / "test.txt"
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.5K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_request_files/test_tutorial001_02_an_py310.py

    
    @needs_py310
    def test_post_file(tmp_path: Path, client: TestClient):
        path = tmp_path / "test.txt"
        path.write_bytes(b"<file content>")
    
        with path.open("rb") as file:
            response = client.post("/files/", files={"file": file})
        assert response.status_code == 200, response.text
        assert response.json() == {"file_size": 14}
    
    
    @needs_py310
    def test_post_upload_file(tmp_path: Path, client: TestClient):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 8.5K bytes
    - Viewed (0)
  8. fastapi/openapi/utils.py

                    path, security_schemes, path_definitions = result
                    if path:
                        webhook_paths.setdefault(webhook.path_format, {}).update(path)
                    if security_schemes:
                        components.setdefault("securitySchemes", {}).update(
                            security_schemes
                        )
                    if path_definitions:
                        definitions.update(path_definitions)
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 21.8K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_sql_databases/test_testing_databases_py39.py

    import importlib
    import os
    from pathlib import Path
    
    import pytest
    
    from ...utils import needs_py39, needs_pydanticv1
    
    
    @needs_py39
    # TODO: pv2 add version with Pydantic v2
    @needs_pydanticv1
    def test_testing_dbs_py39(tmp_path_factory: pytest.TempPathFactory):
        tmp_path = tmp_path_factory.mktemp("data")
        cwd = os.getcwd()
        os.chdir(tmp_path)
        test_db = Path("./test.db")
        if test_db.is_file():  # pragma: nocover
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 822 bytes
    - Viewed (0)
  10. tests/test_openapi_examples.py

            },
        ),
    ):
        return item
    
    
    @app.get("/path_examples/{item_id}")
    def path_examples(
        item_id: str = Path(
            examples=[
                "json_schema_item_1",
                "json_schema_item_2",
            ],
            openapi_examples={
                "Path One": {
                    "summary": "Path One Summary",
                    "description": "Path One Description",
                    "value": "item_1",
                },
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 17K bytes
    - Viewed (0)
Back to top