MCPcopy Index your code
hub / github.com/nonebot/nonebot2 / DummyWS

Class DummyWS

tests/test_driver.py:684–697  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

682)
683async def test_aiohttp_websocket_close_frame(msg_type: str) -> None:
684 class DummyWS(ClientWebSocketResponse):
685 def __init__(self) -> None:
686 pass
687
688 @property
689 def close_code(self) -> None:
690 return None
691
692 @property
693 def closed(self) -> bool:
694 return True
695
696 async def receive(self, timeout: float | None = None) -> WSMessage: # noqa: ASYNC109
697 return WSMessage(type=WSMsgType[msg_type], data=None, extra=None)
698
699 async with ClientSession() as session:
700 ws = AiohttpWebSocket(

Callers 1

Calls

no outgoing calls

Tested by 1