Skip to content

I want to create test for the websocket with infinit loop #17

@nttg8100

Description

@nttg8100

From the example, I have this with the manager is added in an while True:

async def ws(websocket: WebSocket, client_id: str):
    conn = await manager.connect(websocket, client_id)

    try:
        while True:
            await manager.manage(conn)
    except WebSocketDisconnectError:
        await manager.disconnect(conn)

while I only found the example for simple websocket test at this
https://github.com/Neoteroi/BlackSheep/blob/5f9161d3359e5c7366d20e75fbaee9a1185b5dcb/tests/test_websocket.py#L452C1-L485C1

Can you help me to figure out how to create the test using test_client for this case?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions