Search Options

Results per page
Sort
Preferred Languages
Advance

Results 91 - 100 of 227 for p2_test (0.08 sec)

  1. tests/test_tutorial/test_extra_data_types/test_tutorial001_an_py310.py

    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    from ...utils import needs_py310
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.extra_data_types.tutorial001_an_py310 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_py310
    def test_extra_types(client: TestClient):
        item_id = "ff97dd87-a4a5-4a12-b412-cde99f33e00e"
        data = {
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Apr 19 00:11:40 UTC 2024
    - 7K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_query_params/test_tutorial006.py

    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.query_params.tutorial006 import app
    
        c = TestClient(app)
        return c
    
    
    def test_foo_needy_very(client: TestClient):
        response = client.get("/items/foo?needy=very")
        assert response.status_code == 200
        assert response.json() == {
            "item_id": "foo",
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 6.1K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_schema_extra_example/test_tutorial005_an_py39.py

    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    from ...utils import needs_py39
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.schema_extra_example.tutorial005_an_py39 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_py39
    def test_post_body_example(client: TestClient):
        response = client.put(
            "/items/5",
            json={
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Aug 26 18:03:13 UTC 2023
    - 6.8K bytes
    - Viewed (0)
  4. tests/test_dependency_class.py

    from typing import AsyncGenerator, Generator
    
    import pytest
    from fastapi import Depends, FastAPI
    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    
    class CallableDependency:
        def __call__(self, value: str) -> str:
            return value
    
    
    class CallableGenDependency:
        def __call__(self, value: str) -> Generator[str, None, None]:
            yield value
    
    
    class AsyncCallableDependency:
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Aug 09 10:54:05 UTC 2020
    - 3.3K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_request_form_models/test_tutorial002.py

    import pytest
    from fastapi.testclient import TestClient
    
    from tests.utils import needs_pydanticv2
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.request_form_models.tutorial002 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_pydanticv2
    def test_post_body_form(client: TestClient):
        response = client.post("/login/", data={"username": "Foo", "password": "secret"})
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Sep 06 17:31:18 UTC 2024
    - 6.2K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_query_params/test_tutorial006_py310.py

    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    from ...utils import needs_py310
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.query_params.tutorial006_py310 import app
    
        c = TestClient(app)
        return c
    
    
    @needs_py310
    def test_foo_needy_very(client: TestClient):
        response = client.get("/items/foo?needy=very")
        assert response.status_code == 200
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 6.2K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_query_params_str_validations/test_tutorial010.py

    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.query_params_str_validations.tutorial010 import app
    
        client = TestClient(app)
        return client
    
    
    def test_query_params_str_validations_no_query(client: TestClient):
        response = client.get("/items/")
        assert response.status_code == 200
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 6.2K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_query_params_str_validations/test_tutorial010_an_py310.py

    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    from ...utils import needs_py310
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.query_params_str_validations.tutorial010_an_py310 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_py310
    def test_query_params_str_validations_no_query(client: TestClient):
        response = client.get("/items/")
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 6.3K bytes
    - Viewed (0)
  9. docs_src/async_tests/test_main.py

    import pytest
    from httpx import ASGITransport, AsyncClient
    
    from .main import app
    
    
    @pytest.mark.anyio
    async def test_root():
        async with AsyncClient(
            transport=ASGITransport(app=app), base_url="http://test"
        ) as ac:
            response = await ac.get("/")
        assert response.status_code == 200
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Aug 30 16:00:41 UTC 2024
    - 360 bytes
    - Viewed (0)
  10. tests/test_tutorial/test_header_params/test_tutorial001_py310.py

    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    from ...utils import needs_py310
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.header_params.tutorial001_py310 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_py310
    @pytest.mark.parametrize(
        "path,headers,expected_status,expected_response",
        [
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 4K bytes
    - Viewed (0)
Back to top