def test_unsubscribe_list(self): d = self.protocol.unsubscribe( [ "foo/bar/baz1", "foo/bar/baz2", "foo/bar/baz3"] ) self.transport.clear() ack = UNSUBACK() ack.msgId = d.msgId self.protocol.dataReceived(ack.encode()) self.assertEqual(ack.msgId, self.successResultOf(d))
def test_unsubscribe_single(self): d = self.protocol.unsubscribe("foo/bar/baz1") self.transport.clear() ack = UNSUBACK() ack.msgId = d.msgId self.protocol.dataReceived(ack.encode()) self.assertEqual(ack.msgId, self.successResultOf(d))
def test_UNSUBACK_encdec(self): request = UNSUBACK() response = UNSUBACK() request.msgId = 5 response.decode(request.encode()) self.assertEqual(request.msgId, response.msgId)