Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 36 for cark (0.14 sec)

  1. 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)
  2. tests/test_tutorial/test_header_params/test_tutorial001.py

    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    from docs_src.header_params.tutorial001 import app
    
    client = TestClient(app)
    
    
    @pytest.mark.parametrize(
        "path,headers,expected_status,expected_response",
        [
            ("/items", None, 200, {"User-Agent": "testclient"}),
            ("/items", {"X-Header": "notvalid"}, 200, {"User-Agent": "testclient"}),
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 3.8K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_header_params/test_tutorial001_py310.py

    
    @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",
        [
            ("/items", None, 200, {"User-Agent": "testclient"}),
            ("/items", {"X-Header": "notvalid"}, 200, {"User-Agent": "testclient"}),
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 4K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_header_params/test_tutorial003_an.py

    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    from docs_src.header_params.tutorial003_an import app
    
    client = TestClient(app)
    
    
    @pytest.mark.parametrize(
        "path,headers,expected_status,expected_response",
        [
            ("/items", None, 200, {"X-Token values": None}),
            ("/items", {"x-token": "foo"}, 200, {"X-Token values": ["foo"]}),
            # TODO: fix this, is it a bug?
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 4.1K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_cookie_params/test_tutorial001_py310.py

    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    from ...utils import needs_py310
    
    
    @needs_py310
    @pytest.mark.parametrize(
        "path,cookies,expected_status,expected_response",
        [
            ("/items", None, 200, {"ads_id": None}),
            ("/items", {"ads_id": "ads_track"}, 200, {"ads_id": "ads_track"}),
            (
                "/items",
                {"ads_id": "ads_track", "session": "cookiesession"},
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 4.1K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_header_params/test_tutorial002_an_py310.py

    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.header_params.tutorial002_an_py310 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_py310
    @pytest.mark.parametrize(
        "path,headers,expected_status,expected_response",
        [
            ("/items", None, 200, {"strange_header": None}),
            ("/items", {"X-Header": "notvalid"}, 200, {"strange_header": None}),
            (
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 4.2K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_response_model/test_tutorial004.py

    import pytest
    from dirty_equals import IsDict, IsOneOf
    from fastapi.testclient import TestClient
    
    from docs_src.response_model.tutorial004 import app
    
    client = TestClient(app)
    
    
    @pytest.mark.parametrize(
        "url,data",
        [
            ("/items/foo", {"name": "Foo", "price": 50.2}),
            (
                "/items/bar",
                {"name": "Bar", "description": "The bartenders", "price": 62, "tax": 20.2},
            ),
            (
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Aug 04 20:47:07 GMT 2023
    - 5K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_dependencies/test_tutorial004.py

    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    from docs_src.dependencies.tutorial004 import app
    
    client = TestClient(app)
    
    
    @pytest.mark.parametrize(
        "path,expected_status,expected_response",
        [
            (
                "/items",
                200,
                {
                    "items": [
                        {"item_name": "Foo"},
                        {"item_name": "Bar"},
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 5.4K bytes
    - Viewed (0)
  9. tests/test_dependency_overrides.py

        response = client.get("/router-decorator-depends/?q=foo&skip=100&limit=200")
        assert response.status_code == 200
        assert response.json() == {"in": "router-decorator-depends"}
    
    
    @pytest.mark.parametrize(
        "url,status_code,expected",
        [
            (
                "/main-depends/",
                200,
                {"in": "main-depends", "params": {"q": None, "skip": 5, "limit": 10}},
            ),
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 15.4K bytes
    - Viewed (0)
  10. 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)
Back to top