Exemplo n.º 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")
Exemplo n.º 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')
Exemplo n.º 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"}, "ç")
Exemplo n.º 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'}, 'ç')