MCPcopy
hub / github.com/miguelgrinberg/Flask-SocketIO / test_send_json_class_based

Method test_send_json_class_based

test_socketio.py:720–726  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

718 self.assertTrue(received[0]['args'] == 'echo this message back')
719
720 def test_send_json_class_based(self):
721 client = socketio.test_client(app, namespace='/ns')
722 client.get_received('/ns')
723 client.send({'a': 'b'}, json=True, namespace='/ns')
724 received = client.get_received('/ns')
725 self.assertEqual(len(received), 1)
726 self.assertEqual(received[0]['args']['a'], 'b')
727
728 def test_server_disconnected(self):
729 client = socketio.test_client(app, namespace='/ns')

Callers

nothing calls this directly

Calls 3

test_clientMethod · 0.80
get_receivedMethod · 0.80
sendMethod · 0.45

Tested by

no test coverage detected