Search Options

Results per page
Sort
Preferred Languages
Advance

Results 141 - 150 of 294 for ptrtest (0.06 sec)

  1. tests/test_tutorial/test_sql_databases/test_tutorial002.py

        default_registry.dispose()
    
    
    @pytest.fixture(
        name="client",
        params=[
            "tutorial002",
            pytest.param("tutorial002_py39", marks=needs_py39),
            pytest.param("tutorial002_py310", marks=needs_py310),
            "tutorial002_an",
            pytest.param("tutorial002_an_py39", marks=needs_py39),
            pytest.param("tutorial002_an_py310", marks=needs_py310),
        ],
    )
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Wed Oct 09 19:44:42 UTC 2024
    - 19.9K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_request_form_models/test_tutorial002_an.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_an 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)
  3. tests/test_tutorial/test_request_form_models/test_tutorial002_pv1.py

    import pytest
    from fastapi.testclient import TestClient
    
    from tests.utils import needs_pydanticv1
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.request_form_models.tutorial002_pv1 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_pydanticv1
    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
    - 6K bytes
    - Viewed (0)
  4. scripts/test.sh

    #!/usr/bin/env bash
    
    set -e
    set -x
    
    export PYTHONPATH=./docs_src
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Jun 11 21:38:15 UTC 2023
    - 99 bytes
    - Viewed (0)
  5. tests/test_tutorial/test_request_form_models/test_tutorial001_an.py

    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.request_form_models.tutorial001_an import app
    
        client = TestClient(app)
        return client
    
    
    def test_post_body_form(client: TestClient):
        response = client.post("/login/", data={"username": "Foo", "password": "secret"})
        assert response.status_code == 200
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Sep 05 15:16:50 UTC 2024
    - 7.4K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_body_multiple_params/test_tutorial001_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.body_multiple_params.tutorial001_an_py39 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_py39
    def test_post_body_q_bar_content(client: TestClient):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 7.6K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_response_model/test_tutorial004_py39.py

    import pytest
    from dirty_equals import IsDict, IsOneOf
    from fastapi.testclient import TestClient
    
    from ...utils import needs_py39
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.response_model.tutorial004_py39 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_py39
    @pytest.mark.parametrize(
        "url,data",
        [
            ("/items/foo", {"name": "Foo", "price": 50.2}),
            (
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Aug 04 20:47:07 UTC 2023
    - 5.2K bytes
    - Viewed (0)
  8. tests/test_dependency_normal_exceptions.py

    import pytest
    from fastapi import Body, Depends, FastAPI, HTTPException
    from fastapi.testclient import TestClient
    
    initial_fake_database = {"rick": "Rick Sanchez"}
    
    fake_database = initial_fake_database.copy()
    
    initial_state = {"except": False, "finally": False}
    
    state = initial_state.copy()
    
    app = FastAPI()
    
    
    async def get_database():
        temp_database = fake_database.copy()
        try:
            yield temp_database
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Feb 24 23:06:37 UTC 2024
    - 1.9K bytes
    - Viewed (0)
  9. tests/test_jsonable_encoder.py

    from dataclasses import dataclass
    from datetime import datetime, timezone
    from decimal import Decimal
    from enum import Enum
    from pathlib import PurePath, PurePosixPath, PureWindowsPath
    from typing import Optional
    
    import pytest
    from fastapi._compat import PYDANTIC_V2, Undefined
    from fastapi.encoders import jsonable_encoder
    from pydantic import BaseModel, Field, ValidationError
    
    from .utils import needs_pydanticv1, needs_pydanticv2
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 21:56:59 UTC 2024
    - 9K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_request_form_models/test_tutorial001.py

    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.request_form_models.tutorial001 import app
    
        client = TestClient(app)
        return client
    
    
    def test_post_body_form(client: TestClient):
        response = client.post("/login/", data={"username": "Foo", "password": "secret"})
        assert response.status_code == 200
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Sep 05 15:16:50 UTC 2024
    - 7.4K bytes
    - Viewed (0)
Back to top