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

Method test_trigger_event

tests/common/test_client.py:1000–1010  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

998 c._connect_event.set.assert_called_once_with()
999
1000 def test_trigger_event(self):
1001 c = client.Client()
1002 handler = mock.MagicMock()
1003 catchall_handler = mock.MagicMock()
1004 c.on('foo', handler)
1005 c.on('*', catchall_handler)
1006 c._trigger_event('foo', '/', 1, '2')
1007 c._trigger_event('bar', '/', 1, '2', 3)
1008 c._trigger_event('connect', '/') # should not trigger
1009 handler.assert_called_once_with(1, '2')
1010 catchall_handler.assert_called_once_with('bar', 1, '2', 3)
1011
1012 def test_trigger_event_namespace(self):
1013 c = client.Client()

Callers

nothing calls this directly

Calls 2

_trigger_eventMethod · 0.95
onMethod · 0.45

Tested by

no test coverage detected