Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
attdona committed Oct 1, 2017
1 parent 197276b commit 6da27fc
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions burba/tests/test_cc3200_mqtt_leds.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"""
import os
import asyncio
import logging
import sys

# the Leds message
import commands as cmd
Expand All @@ -20,6 +22,13 @@
# import firmware configuration
import tc

logging.basicConfig(
level=logging.DEBUG,
format='%(levelname)s:%(name)s:%(lineno)s: %(message)s',
stream=sys.stderr
)
LOG = logging.getLogger()

EVENTS = (
('board init', 'BOARD_INIT'),
('board ready', 'BOARD_READY')
Expand Down Expand Up @@ -98,11 +107,12 @@ async def test_switch_led():
await cli.publish('{}/{}'.format(tc.network, tc.board), msg_off, qos=QOS_0)

try:
# wait for the ack
message = await cli.deliver_message(timeout=3)
packet = message.publish_packet
print("%s => %s" %
(packet.variable_header.topic_name, str(packet.payload.data)))
for _ in range(2):
# wait for the ack
message = await cli.deliver_message(timeout=3)
packet = message.publish_packet
LOG.debug("%s => %s",
packet.variable_header.topic_name, str(packet.payload.data))
except asyncio.TimeoutError:
assert 0
finally:
Expand Down

0 comments on commit 6da27fc

Please sign in to comment.