async def test_transport_is_closed_connection_close(self, connect_mock): stomp = StompReader(None, self.loop) transport = Mock() stomp.connection_made(transport) connect_mock.assert_called_once() stomp.close()
def test_can_close_connection(self): frame_handler = Mock() heartbeater = Mock() stomp = StompReader(frame_handler, self.loop) stomp.heartbeater = heartbeater stomp.close() heartbeater.shutdown.assert_called_once()
def test_can_close_connection_no_heartbeat(self): frame_handler = Mock() heartbeater = Mock() stomp = StompReader(frame_handler, self.loop) stomp.heartbeater = None stomp.close() heartbeater.shutdown.assert_not_called()