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

Method test_handle_connect

tests/common/test_server.py:300–312  ·  view source on GitHub ↗
(self, eio)

Source from the content-addressed store, hash-verified

298 s.eio.transport.assert_called_once_with('123')
299
300 def test_handle_connect(self, eio):
301 s = server.Server()
302 s.manager.initialize = mock.MagicMock()
303 handler = mock.MagicMock()
304 s.on('connect', handler)
305 s._handle_eio_connect('123', 'environ')
306 s._handle_eio_message('123', '0')
307 assert s.manager.is_connected('1', '/')
308 handler.assert_called_once_with('1', 'environ')
309 s.eio.send.assert_called_once_with('123', '0{"sid":"1"}')
310 assert s.manager.initialize.call_count == 1
311 s._handle_eio_connect('456', 'environ')
312 assert s.manager.initialize.call_count == 1
313
314 def test_handle_connect_with_auth(self, eio):
315 s = server.Server()

Callers

nothing calls this directly

Calls 4

_handle_eio_connectMethod · 0.95
_handle_eio_messageMethod · 0.95
is_connectedMethod · 0.80
onMethod · 0.45

Tested by

no test coverage detected