Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 35 for Glover (0.16 sec)

  1. tests/test_ws_router.py

        pass  # pragma: no cover
    
    
    async def ws_dependency_validate(x_missing: str = Header()):
        pass  # pragma: no cover
    
    
    @router.websocket("/depends-validate/")
    async def router_ws_depends_validate(
        websocket: WebSocket, data=Depends(ws_dependency_validate)
    ):
        pass  # pragma: no cover
    
    
    class CustomError(Exception):
        pass
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Jun 11 19:08:14 GMT 2023
    - 7.5K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_websockets/test_tutorial002_an_py39.py

                )  # pragma: no cover
    
    
    @needs_py39
    def test_websocket_invalid_data(app: FastAPI):
        client = TestClient(app)
        with pytest.raises(WebSocketDisconnect):
            with client.websocket_connect("/items/foo/ws?q=bar&token=some-token"):
                pytest.fail(
                    "did not raise WebSocketDisconnect on __enter__"
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 3.9K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_background_tasks/test_tutorial002.py

    from docs_src.background_tasks.tutorial002 import app
    
    client = TestClient(app)
    
    
    def test():
        log = Path("log.txt")
        if log.is_file():
            os.remove(log)  # pragma: no cover
        response = client.post("/send-notification/******@****.***?q=some-query")
        assert response.status_code == 200, response.text
        assert response.json() == {"message": "Message sent"}
        with open("./log.txt") as f:
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Jul 09 18:06:12 GMT 2020
    - 568 bytes
    - Viewed (0)
  4. tests/test_additional_responses_custom_validationerror.py

        errors: typing.List[Error]
    
    
    @app.get(
        "/a/{id}",
        response_class=JsonApiResponse,
        responses={422: {"description": "Error", "model": JsonApiError}},
    )
    async def a(id):
        pass  # pragma: no cover
    
    
    client = TestClient(app)
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
        assert response.json() == {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 2.9K bytes
    - Viewed (0)
  5. tests/test_params_repr.py

    from dirty_equals import IsOneOf
    from fastapi.params import Body, Cookie, Depends, Header, Param, Path, Query
    
    test_data: List[Any] = ["teststr", None, ..., 1, []]
    
    
    def get_user():
        return {}  # pragma: no cover
    
    
    def test_param_repr_str():
        assert repr(Param("teststr")) == "Param(teststr)"
    
    
    def test_param_repr_none():
        assert repr(Param(None)) == "Param(None)"
    
    
    def test_param_repr_ellipsis():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 3.3K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_websockets/test_tutorial002_an.py

                )  # pragma: no cover
    
    
    def test_websocket_invalid_data():
        client = TestClient(app)
        with pytest.raises(WebSocketDisconnect):
            with client.websocket_connect("/items/foo/ws?q=bar&token=some-token"):
                pytest.fail(
                    "did not raise WebSocketDisconnect on __enter__"
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 3.6K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_background_tasks/test_tutorial001.py

    from docs_src.background_tasks.tutorial001 import app
    
    client = TestClient(app)
    
    
    def test():
        log = Path("log.txt")
        if log.is_file():
            os.remove(log)  # pragma: no cover
        response = client.post("/send-notification/******@****.***")
        assert response.status_code == 200, response.text
        assert response.json() == {"message": "Notification sent in the background"}
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Jul 09 18:06:12 GMT 2020
    - 578 bytes
    - Viewed (0)
  8. tests/test_additional_responses_response_class.py

        "/a",
        response_class=JsonApiResponse,
        responses={500: {"description": "Error", "model": JsonApiError}},
    )
    async def a():
        pass  # pragma: no cover
    
    
    @app.get("/b", responses={500: {"description": "Error", "model": Error}})
    async def b():
        pass  # pragma: no cover
    
    
    client = TestClient(app)
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 3.5K bytes
    - Viewed (0)
  9. tests/test_additional_responses_custom_model_in_callback.py

    
    @callback_router.get(
        "{$callback_url}/callback/", responses={400: {"model": CustomModel}}
    )
    def callback_route():
        pass  # pragma: no cover
    
    
    @app.post("/", callbacks=callback_router.routes)
    def main_route(callback_url: HttpUrl):
        pass  # pragma: no cover
    
    
    client = TestClient(app)
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 5.8K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_websockets/test_tutorial002_py310.py

                )  # pragma: no cover
    
    
    @needs_py310
    def test_websocket_invalid_data(app: FastAPI):
        client = TestClient(app)
        with pytest.raises(WebSocketDisconnect):
            with client.websocket_connect("/items/foo/ws?q=bar&token=some-token"):
                pytest.fail(
                    "did not raise WebSocketDisconnect on __enter__"
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 3.9K bytes
    - Viewed (0)
Back to top