Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 592 for Leeds (0.18 sec)

  1. tests/test_tutorial/test_separate_openapi_schemas/test_tutorial002_py310.py

    import pytest
    from fastapi.testclient import TestClient
    
    from ...utils import needs_py310, needs_pydanticv2
    
    
    @pytest.fixture(name="client")
    def get_client() -> TestClient:
        from docs_src.separate_openapi_schemas.tutorial002_py310 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_py310
    def test_create_item(client: TestClient) -> None:
        response = client.post("/items/", json={"name": "Foo"})
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Aug 25 19:10:22 GMT 2023
    - 4.9K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_schema_extra_example/test_tutorial001_py310.py

    import pytest
    from fastapi.testclient import TestClient
    
    from ...utils import needs_py310, needs_pydanticv2
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.schema_extra_example.tutorial001_py310 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_py310
    @needs_pydanticv2
    def test_post_body_example(client: TestClient):
        response = client.put(
            "/items/5",
            json={
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 4.7K bytes
    - Viewed (0)
  3. tests/test_datetime_custom_encoder.py

    from datetime import datetime, timezone
    
    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    from pydantic import BaseModel
    
    from .utils import needs_pydanticv1, needs_pydanticv2
    
    
    @needs_pydanticv2
    def test_pydanticv2():
        from pydantic import field_serializer
    
        class ModelWithDatetimeField(BaseModel):
            dt_field: datetime
    
            @field_serializer("dt_field")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 1.6K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial007_pv1.py

    import pytest
    from fastapi.testclient import TestClient
    
    from ...utils import needs_pydanticv1
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.path_operation_advanced_configuration.tutorial007_pv1 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_pydanticv1
    def test_post(client: TestClient):
        yaml_data = """
            name: Deadpoolio
            tags:
            - x-force
            - x-men
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 3.2K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_path_operation_configurations/test_tutorial005_py310.py

    import pytest
    from fastapi.testclient import TestClient
    
    from ...utils import needs_py310, needs_pydanticv1, needs_pydanticv2
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.path_operation_configuration.tutorial005_py310 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_py310
    def test_query_params_str_validations(client: TestClient):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Sep 28 04:14:40 GMT 2023
    - 8.9K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_path_operation_configurations/test_tutorial005_py39.py

    import pytest
    from fastapi.testclient import TestClient
    
    from ...utils import needs_py39, needs_pydanticv1, needs_pydanticv2
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.path_operation_configuration.tutorial005_py39 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_py39
    def test_query_params_str_validations(client: TestClient):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Sep 28 04:14:40 GMT 2023
    - 8.9K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_separate_openapi_schemas/test_tutorial001_py39.py

    import pytest
    from fastapi.testclient import TestClient
    
    from ...utils import needs_py39, needs_pydanticv2
    
    
    @pytest.fixture(name="client")
    def get_client() -> TestClient:
        from docs_src.separate_openapi_schemas.tutorial001_py39 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_py39
    def test_create_item(client: TestClient) -> None:
        response = client.post("/items/", json={"name": "Foo"})
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Sep 28 04:14:40 GMT 2023
    - 4.9K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial007.py

    import pytest
    from fastapi.testclient import TestClient
    
    from ...utils import needs_pydanticv2
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.path_operation_advanced_configuration.tutorial007 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_pydanticv2
    def test_post(client: TestClient):
        yaml_data = """
            name: Deadpoolio
            tags:
            - x-force
            - x-men
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 3.3K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_conditional_openapi/test_tutorial001.py

    import importlib
    
    from fastapi.testclient import TestClient
    
    from ...utils import needs_pydanticv2
    
    
    def get_client() -> TestClient:
        from docs_src.conditional_openapi import tutorial001
    
        importlib.reload(tutorial001)
    
        client = TestClient(tutorial001.app)
        return client
    
    
    @needs_pydanticv2
    def test_disable_openapi(monkeypatch):
        monkeypatch.setenv("OPENAPI_URL", "")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 1.8K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_security/test_tutorial005_an_py310.py

        return access_token
    
    
    @needs_py310
    def test_login(client: TestClient):
        response = client.post("/token", data={"username": "johndoe", "password": "secret"})
        assert response.status_code == 200, response.text
        content = response.json()
        assert "access_token" in content
        assert content["token_type"] == "bearer"
    
    
    @needs_py310
    def test_login_incorrect_password(client: TestClient):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 16.3K bytes
    - Viewed (0)
Back to top