Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 470 for latest (0.15 sec)

  1. scripts/docs.py

        generated_content = generate_readme_content()
        readme_content = readme_path.read_text("utf-8")
        if generated_content != readme_content:
            typer.secho(
                "README.md outdated from the latest index.md", color=typer.colors.RED
            )
            raise typer.Abort()
        typer.echo("Valid README ✅")
    
    
    @app.command()
    def build_all() -> None:
        """
    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)
  2. docs_src/app_testing/app_b/test_main.py

    from .main import app
    
    client = TestClient(app)
    
    
    def test_read_item():
        response = client.get("/items/foo", headers={"X-Token": "coneofsilence"})
        assert response.status_code == 200
        assert response.json() == {
            "id": "foo",
            "title": "Foo",
            "description": "There goes my hero",
        }
    
    
    def test_read_item_bad_token():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 1.8K bytes
    - Viewed (0)
  3. docs_src/async_tests/test_main.py

    import pytest
    from httpx import AsyncClient
    
    from .main import app
    
    
    @pytest.mark.anyio
    async def test_root():
        async with AsyncClient(app=app, base_url="http://test") as ac:
            response = await ac.get("/")
        assert response.status_code == 200
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Oct 06 15:32:11 GMT 2021
    - 306 bytes
    - Viewed (0)
  4. tests/test_application.py

    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    from .main import app
    
    client = TestClient(app)
    
    
    @pytest.mark.parametrize(
        "path,expected_status,expected_response",
        [
            ("/api_route", 200, {"message": "Hello World"}),
            ("/non_decorated_route", 200, {"message": "Hello World"}),
            ("/nonexistent", 404, {"detail": "Not Found"}),
        ],
    )
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 52.2K bytes
    - Viewed (0)
  5. tests/test_tuples.py

        return values
    
    
    client = TestClient(app)
    
    
    def test_model_with_tuple_valid():
        data = {"items": [["foo", "bar"], ["baz", "whatelse"]]}
        response = client.post("/model-with-tuple/", json=data)
        assert response.status_code == 200, response.text
        assert response.json() == data
    
    
    def test_model_with_tuple_invalid():
        data = {"items": [["foo", "bar"], ["baz", "whatelse", "too", "much"]]}
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 11.8K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_background_tasks/test_tutorial002.py

    import os
    from pathlib import Path
    
    from fastapi.testclient import TestClient
    
    from docs_src.background_tasks.tutorial002 import app
    
    client = TestClient(app)
    
    
    def test():
        log = Path("log.txt")
        if log.is_file():
            os.remove(log)  # pragma: no cover
        response = client.post("/send-notification/******@****.***?q=some-query")
        assert response.status_code == 200, response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Jul 09 18:06:12 GMT 2020
    - 568 bytes
    - Viewed (0)
  7. tests/test_tutorial/test_behind_a_proxy/test_tutorial003.py

    from fastapi.testclient import TestClient
    
    from docs_src.behind_a_proxy.tutorial003 import app
    
    client = TestClient(app)
    
    
    def test_main():
        response = client.get("/app")
        assert response.status_code == 200
        assert response.json() == {"message": "Hello World", "root_path": "/api/v1"}
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200
        assert response.json() == {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 1.6K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_advanced_middleware/test_tutorial001.py

    from fastapi.testclient import TestClient
    
    from docs_src.advanced_middleware.tutorial001 import app
    
    
    def test_middleware():
        client = TestClient(app, base_url="https://testserver")
        response = client.get("/")
        assert response.status_code == 200, response.text
    
        client = TestClient(app)
        response = client.get("/", follow_redirects=False)
        assert response.status_code == 307, response.text
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Nov 13 14:26:09 GMT 2022
    - 474 bytes
    - Viewed (0)
  9. tests/test_tutorial/test_advanced_middleware/test_tutorial003.py

    from docs_src.advanced_middleware.tutorial003 import app
    
    
    @app.get("/large")
    async def large():
        return PlainTextResponse("x" * 4000, status_code=200)
    
    
    client = TestClient(app)
    
    
    def test_middleware():
        response = client.get("/large", headers={"accept-encoding": "gzip"})
        assert response.status_code == 200, response.text
        assert response.text == "x" * 4000
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Jul 09 18:06:12 GMT 2020
    - 665 bytes
    - Viewed (0)
  10. tests/test_tutorial/test_body_multiple_params/test_tutorial003.py

    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.body_multiple_params.tutorial003 import app
    
        client = TestClient(app)
        return client
    
    
    def test_post_body_valid(client: TestClient):
        response = client.put(
            "/items/5",
            json={
                "importance": 2,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 9.4K bytes
    - Viewed (0)
Back to top