Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 294 for ptrtest (0.05 sec)

  1. tests/test_tutorial/test_websockets/test_tutorial002_an.py

    def test_websocket_no_credentials():
        client = TestClient(app)
        with pytest.raises(WebSocketDisconnect):
            with client.websocket_connect("/items/foo/ws"):
                pytest.fail(
                    "did not raise WebSocketDisconnect on __enter__"
                )  # pragma: no cover
    
    
    def test_websocket_invalid_data():
        client = TestClient(app)
        with pytest.raises(WebSocketDisconnect):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 3.6K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_query_param_models/test_tutorial002.py

            pytest.param("tutorial002_an", marks=needs_pydanticv2),
            pytest.param("tutorial002_an_py39", marks=[needs_py39, needs_pydanticv2]),
            pytest.param("tutorial002_an_py310", marks=[needs_py310, needs_pydanticv2]),
            pytest.param("tutorial002_pv1", marks=[needs_pydanticv1, needs_pydanticv1]),
            pytest.param("tutorial002_pv1_py39", marks=[needs_py39, needs_pydanticv1]),
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Sep 17 18:54:10 UTC 2024
    - 10.4K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_query_param_models/test_tutorial001.py

    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    from inline_snapshot import snapshot
    
    from tests.utils import needs_py39, needs_py310
    
    
    @pytest.fixture(
        name="client",
        params=[
            "tutorial001",
            pytest.param("tutorial001_py39", marks=needs_py39),
            pytest.param("tutorial001_py310", marks=needs_py310),
            "tutorial001_an",
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Sep 17 18:54:10 UTC 2024
    - 9.2K bytes
    - Viewed (0)
  4. tests/test_multipart_installation.py

    import warnings
    
    import pytest
    from fastapi import FastAPI, File, Form, UploadFile
    from fastapi.dependencies.utils import (
        multipart_incorrect_install_error,
        multipart_not_installed_error,
    )
    
    
    def test_incorrect_multipart_installed_form(monkeypatch):
        monkeypatch.setattr("python_multipart.__version__", "0.0.12")
        with warnings.catch_warnings(record=True):
            warnings.simplefilter("always")
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 27 21:46:26 UTC 2024
    - 5.7K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_header_param_models/test_tutorial001.py

    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    from inline_snapshot import snapshot
    
    from tests.utils import needs_py39, needs_py310
    
    
    @pytest.fixture(
        name="client",
        params=[
            "tutorial001",
            pytest.param("tutorial001_py39", marks=needs_py39),
            pytest.param("tutorial001_py310", marks=needs_py310),
            "tutorial001_an",
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Sep 17 18:54:10 UTC 2024
    - 8.7K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_websockets/test_tutorial002_an_py39.py

        client = TestClient(app)
        with pytest.raises(WebSocketDisconnect):
            with client.websocket_connect("/items/foo/ws"):
                pytest.fail(
                    "did not raise WebSocketDisconnect on __enter__"
                )  # pragma: no cover
    
    
    @needs_py39
    def test_websocket_invalid_data(app: FastAPI):
        client = TestClient(app)
        with pytest.raises(WebSocketDisconnect):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 3.9K bytes
    - Viewed (0)
  7. tests/test_ambiguous_params.py

    import pytest
    from fastapi import Depends, FastAPI, Path
    from fastapi.param_functions import Query
    from fastapi.testclient import TestClient
    from fastapi.utils import PYDANTIC_V2
    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    def test_no_annotated_defaults():
        with pytest.raises(
            AssertionError, match="Path parameters cannot have a default value"
        ):
    
            @app.get("/items/{item_id}/")
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Dec 12 00:22:47 UTC 2023
    - 2.1K bytes
    - Viewed (0)
  8. tests/test_invalid_sequence_param.py

    from typing import Dict, List, Optional, Tuple
    
    import pytest
    from fastapi import FastAPI, Query
    from pydantic import BaseModel
    
    
    def test_invalid_sequence():
        with pytest.raises(AssertionError):
            app = FastAPI()
    
            class Item(BaseModel):
                title: str
    
            @app.get("/items/")
            def read_items(q: List[Item] = Query(default=None)):
                pass  # pragma: no cover
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri May 13 23:38:22 UTC 2022
    - 1.2K bytes
    - Viewed (0)
  9. tests/test_allow_inf_nan_in_enforcing.py

    
    @pytest.mark.parametrize(
        "value,code",
        [
            ("-1", 200),
            ("inf", 200),
            ("-inf", 200),
            ("nan", 200),
            ("0", 200),
            ("342", 200),
        ],
    )
    def test_allow_inf_nan_param_true(value: str, code: int):
        response = client.post(f"/?x={value}")
        assert response.status_code == code, response.text
    
    
    @pytest.mark.parametrize(
        "value,code",
        [
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Aug 24 19:27:37 UTC 2024
    - 1.8K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_events/test_tutorial002.py

    import pytest
    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    
    
    @pytest.fixture(name="app", scope="module")
    def get_app():
        with pytest.warns(DeprecationWarning):
            from docs_src.events.tutorial002 import app
        yield app
    
    
    def test_events(app: FastAPI):
        with TestClient(app) as client:
            response = client.get("/items/")
            assert response.status_code == 200, response.text
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Wed Oct 18 12:36:40 UTC 2023
    - 1.4K bytes
    - Viewed (0)
Back to top