Skip to content

Commit

Permalink
pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
attdona committed Sep 30, 2017
1 parent d9b5ed1 commit c8f687f
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions burba/tests/test_cc3200_mqtt_leds.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@
import pynais.iottest as iot

import hbmqtt.client as mqtt
from hbmqtt.mqtt.constants import QOS_0, QOS_1, QOS_2
from hbmqtt.mqtt.constants import QOS_0
import hbmqtt.broker

# import firmware configuration
import tc

import time

events = (
EVENTS = (
('board init', 'BOARD_INIT'),
('board ready', 'BOARD_READY')
)

def handle_event(event, uart):
"""set wlan uid/password using serial port
"""
if (event.name == 'BOARD_INIT'):
profile = ns.msg.Profile(
os.environ['TEST_UID'], pwd=os.environ['TEST_PWD'])
Expand All @@ -47,6 +47,8 @@ def handle_event(event, uart):


async def start_broker():
"""start mqtt borker before running the test
"""
config = {
'listeners': {
'default': {
Expand All @@ -68,15 +70,19 @@ async def start_broker():


def test_init_board():
"""compile, flash and provisioning of uid/pwd
"""

# check that wlan env variables username and password are set
tc.check_test_requirements()

iot.run('nais', tc.fw_deploy_ctx, events=events, handler=handle_event)
iot.run('nais', tc.fw_deploy_ctx, events=EVENTS, handler=handle_event)


@pytest.mark.asyncio
async def test_switch_led():
"""switch on and off the red led
"""
broker = await start_broker()

msg_on = ns.marshall(cmd.Leds(red='on'))
Expand Down

0 comments on commit c8f687f

Please sign in to comment.