コード例 #1
0
 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))
コード例 #2
0
 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))
コード例 #3
0
    def test_UNSUBACK_encdec(self):
        request = UNSUBACK()
        response = UNSUBACK()
        request.msgId = 5

        response.decode(request.encode())
        self.assertEqual(request.msgId, response.msgId)
コード例 #4
0
ファイル: test_pdu.py プロジェクト: Wisit/twisted-mqtt
 def test_UNSUBACK_encdec(self):
     request  = UNSUBACK()
     response = UNSUBACK()
     request.msgId = 5
     
     response.decode(request.encode())
     self.assertEqual(request.msgId, response.msgId)