Example #1
0
    def test_remote_message_exc(self):
        messages = []
        handler = self.make_handler(messages, exc=True)
        session = self.make_session(handler=handler)

        self.loop.run_until_complete(session._remote_message('msg'))
        self.assertEqual(messages, [])
Example #2
0
    def test_remote_message(self):
        messages = []
        session = self.make_session(result=messages)

        self.loop.run_until_complete(session._remote_message('msg'))
        self.assertEqual(
            messages,
            [(protocol.SockjsMessage(tp=protocol.MSG_MESSAGE, data='msg'),
              session)])