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 c8f687f commit 12e6074
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions burba/tests/test_cc3200_mqtt_profile.py
Original file line number Diff line number Diff line change
@@ -1,31 +1,28 @@
"""Test mqtt messages exchanges between a client and the cc3200 board
"""
import pytest
import os
import asyncio
import pytest
import pynais as ns

# the Leds message
import commands as cmd

# the firmware test machinery
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):
"""manage events from board
"""
if (event.name == 'BOARD_INIT'):
profile = ns.msg.Profile(
os.environ['TEST_UID'], pwd=os.environ['TEST_PWD'])
Expand All @@ -45,6 +42,8 @@ def handle_event(event, uart):


async def start_broker():
"""start mqtt broker
"""
config = {
'listeners': {
'default': {
Expand All @@ -66,15 +65,18 @@ async def start_broker():


def test_init_board():

"""compile, flash and setup wlan 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_add_profile():
"""add a wlan profile
"""
broker = await start_broker()

profile = ns.msg.Profile(uid='baba', pwd='there_is_no_secret_for_me')
Expand Down

0 comments on commit 12e6074

Please sign in to comment.