MCPcopy Create free account
hub / github.com/miguelgrinberg/python-socketio / test_disconnect

Method test_disconnect

tests/async/test_server.py:884–893  ·  view source on GitHub ↗
(self, eio)

Source from the content-addressed store, hash-verified

882 await _test()
883
884 async def test_disconnect(self, eio):
885 eio.return_value.send = mock.AsyncMock()
886 eio.return_value.disconnect = mock.AsyncMock()
887 s = async_server.AsyncServer()
888 s.handlers['/'] = {}
889 await s._handle_eio_connect('123', 'environ')
890 await s._handle_eio_message('123', '0')
891 await s.disconnect('1')
892 s.eio.send.assert_any_await('123', '1')
893 assert not s.manager.is_connected('1', '/')
894
895 async def test_disconnect_ignore_queue(self, eio):
896 eio.return_value.send = mock.AsyncMock()

Callers

nothing calls this directly

Calls 4

_handle_eio_connectMethod · 0.95
_handle_eio_messageMethod · 0.95
disconnectMethod · 0.95
is_connectedMethod · 0.80

Tested by

no test coverage detected