Example #1
0
    async def test_can_send_frame(self):
        stomp = StompReader(None, self.loop)
        stomp._transport = Mock()

        stomp.send_frame("SUBSCRIBE", {"ack": "auto"}, "ç")

        stomp._transport.write.assert_called_with(b"SUBSCRIBE\n"
                                                  b"ack:auto\n"
                                                  b"\n"
                                                  b"\xc3\xa7\x00")
Example #2
0
    async def test_can_send_frame(self):
        stomp = StompReader(None, self.loop)
        stomp._transport = Mock()

        stomp.send_frame('SUBSCRIBE', {'ack': 'auto'}, 'ç')

        stomp._transport.write.assert_called_with(b'SUBSCRIBE\n'
                                                  b'ack:auto\n'
                                                  b'\n'
                                                  b'\xc3\xa7\x00')
Example #3
0
    async def test_send_frame_can_raise_error(self):
        stomp = StompReader(None, self.loop)
        stomp._transport = None

        with self.assertRaises(StompDisconnectedError):
            stomp.send_frame("SUBSCRIBE", {"ack": "auto"}, "ç")
Example #4
0
    async def test_send_frame_can_raise_error(self):
        stomp = StompReader(None, self.loop)
        stomp._transport = None

        with self.assertRaises(StompDisconnectedError):
            stomp.send_frame('SUBSCRIBE', {'ack': 'auto'}, 'ç')