Search Options

Results per page
Sort
Preferred Languages
Advance

Results 101 - 110 of 294 for ptrtest (0.05 sec)

  1. 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"}),
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 3.8K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_header_params/test_tutorial002.py

    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    from docs_src.header_params.tutorial002 import app
    
    client = TestClient(app)
    
    
    @pytest.mark.parametrize(
        "path,headers,expected_status,expected_response",
        [
            ("/items", None, 200, {"strange_header": None}),
            ("/items", {"X-Header": "notvalid"}, 200, {"strange_header": None}),
            (
                "/items",
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 4K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_header_params/test_tutorial003.py

    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    from docs_src.header_params.tutorial003 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"]}),
            (
                "/items",
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jan 12 14:52:00 UTC 2024
    - 4.1K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_query_params_str_validations/test_tutorial012_an_py39.py

    import pytest
    from fastapi.testclient import TestClient
    
    from ...utils import needs_py39
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.query_params_str_validations.tutorial012_an_py39 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_py39
    def test_default_query_values(client: TestClient):
        url = "/items/"
        response = client.get(url)
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 3.6K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_dependencies/test_tutorial008c_an.py

    import pytest
    from fastapi.exceptions import FastAPIError
    from fastapi.testclient import TestClient
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.dependencies.tutorial008c_an import app
    
        client = TestClient(app)
        return client
    
    
    def test_get_no_item(client: TestClient):
        response = client.get("/items/foo")
        assert response.status_code == 404, response.text
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Feb 24 23:06:37 UTC 2024
    - 1.1K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_response_model/test_tutorial003_py310.py

    import pytest
    from dirty_equals import IsDict, IsOneOf
    from fastapi.testclient import TestClient
    
    from ...utils import needs_py310
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.response_model.tutorial003_py310 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_py310
    def test_post_user(client: TestClient):
        response = client.post(
            "/user/",
            json={
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Aug 04 20:47:07 UTC 2023
    - 5.8K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_dependencies/test_tutorial008d.py

    import pytest
    from fastapi.testclient import TestClient
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.dependencies.tutorial008d import app
    
        client = TestClient(app)
        return client
    
    
    def test_get_no_item(client: TestClient):
        response = client.get("/items/foo")
        assert response.status_code == 404, response.text
        assert response.json() == {"detail": "Item not found, there's only a plumbus here"}
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Feb 24 23:06:37 UTC 2024
    - 1.2K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_cookie_params/test_tutorial001_an_py39.py

    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    from ...utils import needs_py39
    
    
    @needs_py39
    @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"},
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 4.1K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_schema_extra_example/test_tutorial001_py310_pv1.py

    import pytest
    from fastapi.testclient import TestClient
    
    from ...utils import needs_py310, needs_pydanticv1
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.schema_extra_example.tutorial001_py310_pv1 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_py310
    @needs_pydanticv1
    def test_post_body_example(client: TestClient):
        response = client.put(
            "/items/5",
            json={
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 4.5K bytes
    - Viewed (0)
  10. 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?
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 4.1K bytes
    - Viewed (0)
Back to top