From 09e2f208f08c34c2229acec4a4a53da43e1b12bc Mon Sep 17 00:00:00 2001 From: Nicolas Jouanin Date: Fri, 26 Jun 2015 22:26:50 +0200 Subject: [PATCH] (should) fix tests --- hbmqtt/test_client.py | 36 ++++++++++++++++++------------------ tests/mqtt/test_pubrel.py | 2 +- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/hbmqtt/test_client.py b/hbmqtt/test_client.py index 86fc4b5..bab3ce9 100644 --- a/hbmqtt/test_client.py +++ b/hbmqtt/test_client.py @@ -2,22 +2,22 @@ import logging from hbmqtt.client._client import MQTTClient import asyncio -C=MQTTClient() - -@asyncio.coroutine -def test_coro(): - yield from C.connect(uri='mqtt://iot.eclipse.org:1883/', username='testuser', password="passwd") - yield from asyncio.sleep(1) - yield from C.publish('a/b', b'0123456789') - yield from C.publish('a/b', b'0123456789', qos=0x01) - yield from C.publish('a/b', b'0123456789', qos=0x02) - yield from C.subscribe([ - {'filter': 'a/b', 'qos': 0x01}, - {'filter': 'c/d', 'qos': 0x02} - ]) - #yield from asyncio.sleep(10) - yield from C.disconnect() - -if __name__ == '__main__': - logging.basicConfig(level=logging.DEBUG) +# C=MQTTClient() +# +# @asyncio.coroutine +# def test_coro(): +# yield from C.connect(uri='mqtt://iot.eclipse.org:1883/', username='testuser', password="passwd") +# yield from asyncio.sleep(1) +# yield from C.publish('a/b', b'0123456789') +# yield from C.publish('a/b', b'0123456789', qos=0x01) +# yield from C.publish('a/b', b'0123456789', qos=0x02) +# yield from C.subscribe([ +# {'filter': 'a/b', 'qos': 0x01}, +# {'filter': 'c/d', 'qos': 0x02} +# ]) +# #yield from asyncio.sleep(10) +# yield from C.disconnect() +# +# if __name__ == '__main__': +# logging.basicConfig(level=logging.DEBUG) # asyncio.get_event_loop().run_until_complete(test_coro()) \ No newline at end of file diff --git a/tests/mqtt/test_pubrel.py b/tests/mqtt/test_pubrel.py index 818e745..db9cd65 100644 --- a/tests/mqtt/test_pubrel.py +++ b/tests/mqtt/test_pubrel.py @@ -21,4 +21,4 @@ class PubrelPacketTest(unittest.TestCase): variable_header = PacketIdVariableHeader(10) publish = PubrelPacket(variable_header=variable_header) out = publish.to_bytes() - self.assertEqual(out, b'\x60\x02\x00\x0a') \ No newline at end of file + self.assertEqual(out, b'\x62\x02\x00\x0a') \ No newline at end of file