Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 959 for Wain (0.26 sec)

  1. docs_src/app_testing/app_b_an_py310/test_main.py

    from fastapi.testclient import TestClient
    
    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: 2023-12-03 07:19
    - Last Modified: 2023-03-18 12:29
    - 1.8K bytes
    - Viewed (0)
  2. .github/actions/people/app/main.py

                        "count": count,
                        "avatarUrl": author.avatarUrl,
                        "url": author.url,
                    }
                )
        return users
    
    
    if __name__ == "__main__":
        logging.basicConfig(level=logging.INFO)
        settings = Settings()
        logging.info(f"Using config: {settings.model_dump_json()}")
        g = Github(settings.input_token.get_secret_value())
    Python
    - Registered: 2023-12-03 07:19
    - Last Modified: 2023-08-02 15:57
    - 19.4K bytes
    - Viewed (1)
  3. tests/test_modules_same_name_body/test_main.py

    from fastapi.testclient import TestClient
    
    from .app.main import app
    
    client = TestClient(app)
    
    
    def test_post_a():
        data = {"a": 2, "b": "foo"}
        response = client.post("/a/compute", json=data)
        assert response.status_code == 200, response.text
        data = response.json()
    
    
    def test_post_a_invalid():
        data = {"a": "bar", "b": "foo"}
        response = client.post("/a/compute", json=data)
    Python
    - Registered: 2023-12-03 07:19
    - Last Modified: 2023-06-30 18:25
    - 5.6K bytes
    - Viewed (0)
  4. 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: 2023-12-03 07:19
    - Last Modified: 2021-10-06 15:32
    - 306 bytes
    - Viewed (0)
  5. docs_src/settings/app02/test_main.py

    from fastapi.testclient import TestClient
    
    from .config import Settings
    from .main import app, get_settings
    
    client = TestClient(app)
    
    
    def get_settings_override():
        return Settings(admin_email="******@****.***")
    
    
    app.dependency_overrides[get_settings] = get_settings_override
    
    
    def test_app():
        response = client.get("/info")
        data = response.json()
        assert data == {
            "app_name": "Awesome API",
    Python
    - Registered: 2023-12-03 07:19
    - Last Modified: 2021-07-29 09:26
    - 515 bytes
    - Viewed (0)
  6. docs_src/settings/app02_an_py39/test_main.py

    from fastapi.testclient import TestClient
    
    from .config import Settings
    from .main import app, get_settings
    
    client = TestClient(app)
    
    
    def get_settings_override():
        return Settings(admin_email="******@****.***")
    
    
    app.dependency_overrides[get_settings] = get_settings_override
    
    
    def test_app():
        response = client.get("/info")
        data = response.json()
        assert data == {
            "app_name": "Awesome API",
    Python
    - Registered: 2023-12-03 07:19
    - Last Modified: 2023-03-18 12:29
    - 515 bytes
    - Viewed (0)
  7. docs_src/async_tests/main.py

    Felix Böhm <******@****.***> 1596909678 +0200
    Python
    - Registered: 2023-12-03 07:19
    - Last Modified: 2020-08-08 18:01
    - 112 bytes
    - Viewed (0)
  8. docs_src/settings/app01/main.py

    Marcelo Trylesinski <******@****.***> 1627550767 +0200
    Python
    - Registered: 2023-12-03 07:19
    - Last Modified: 2021-07-29 09:26
    - 267 bytes
    - Viewed (0)
  9. docs_src/sql_databases_peewee/sql_app/main.py

    Sebastián Ramírez <******@****.***> 1585249793 +0100
    Python
    - Registered: 2023-12-03 07:19
    - Last Modified: 2020-03-26 19:09
    - 2.2K bytes
    - Viewed (0)
  10. docs_src/settings/app03/main.py

    Sebastián Ramírez <******@****.***> 1698179166 +0400
    Python
    - Registered: 2023-12-03 07:19
    - Last Modified: 2023-10-24 20:26
    - 412 bytes
    - Viewed (0)
Back to top