minor fixes

This commit is contained in:
Mike Kinney
2021-12-06 23:36:03 -08:00
parent 0223b00226
commit c5500291ce
5 changed files with 7 additions and 12 deletions

View File

@@ -7,7 +7,7 @@
# Add files or directories matching the regex patterns to the blacklist. The
# regex matches against base names, not paths.
ignore-patterns=mqtt_pb2.py,channel_pb2.py,environmental_measurement_pb2.py,admin_pb2.py,radioconfig_pb2.py,deviceonly_pb2.py,apponly_pb2.py,remote_hardware_pb2.py,portnums_pb2.py,mesh_pb2.py
ignore-patterns=mqtt_pb2.py,channel_pb2.py,environmental_measurement_pb2.py,admin_pb2.py,radioconfig_pb2.py,deviceonly_pb2.py,apponly_pb2.py,remote_hardware_pb2.py,portnums_pb2.py,mesh_pb2.py,storeforward_pb2.py

View File

@@ -438,7 +438,7 @@ def onConnected(interface):
enable = args.ch_enable # should we enable this channel?
if or args.ch_longslow or args.ch_longsfast or args.ch_mediumslow or args.ch_mediumsfast or args.ch_shortslow or args.ch_shortfast:
if args.ch_longslow or args.ch_longsfast or args.ch_mediumslow or args.ch_mediumsfast or args.ch_shortslow or args.ch_shortfast:
if channelIndex != 0:
raise Exception(
"standard channel settings can only be applied to the PRIMARY channel")

View File

@@ -1,7 +1,6 @@
"""Meshtastic integration tests"""
import re
import subprocess
import platform
import pytest

View File

@@ -1,7 +1,6 @@
"""Meshtastic smoke tests with a single device"""
import re
import subprocess
import platform
import time
import os
@@ -18,7 +17,7 @@ PAUSE_AFTER_COMMAND = 2
@pytest.mark.smoke1
def test_smoke1_reboot():
"""Test reboot"""
return_value, out = subprocess.getstatusoutput('meshtastic --reboot')
return_value, _ = subprocess.getstatusoutput('meshtastic --reboot')
assert return_value == 0
# pause for the radio to reset (10 seconds for the pause, and a few more seconds to be back up)
time.sleep(18)
@@ -54,7 +53,7 @@ def test_smoke1_seriallog_to_file():
filename = 'tmpoutput.txt'
if os.path.exists(f"{filename}"):
os.remove(f"{filename}")
return_value, out = subprocess.getstatusoutput(f'meshtastic --info --seriallog {filename}')
return_value, _ = subprocess.getstatusoutput(f'meshtastic --info --seriallog {filename}')
assert os.path.exists(f"{filename}")
assert return_value == 0
os.remove(f"{filename}")
@@ -66,7 +65,7 @@ def test_smoke1_qr():
filename = 'tmpqr'
if os.path.exists(f"{filename}"):
os.remove(f"{filename}")
return_value, out = subprocess.getstatusoutput(f'meshtastic --qr > {filename}')
return_value, _ = subprocess.getstatusoutput(f'meshtastic --qr > {filename}')
assert os.path.exists(f"{filename}")
# not really testing that a valid qr code is created, just that the file size
# is reasonably big enough for a qr code
@@ -319,7 +318,7 @@ def test_smoke1_seturl_invalid_url():
"""Test --seturl with invalid url"""
# Note: This url is no longer a valid url.
url = "https://www.meshtastic.org/c/#GAMiENTxuzogKQdZ8Lz_q89Oab8qB0RlZmF1bHQ="
return_value, out = subprocess.getstatusoutput(f"meshtastic --seturl {url}")
_, out = subprocess.getstatusoutput(f"meshtastic --seturl {url}")
assert re.match(r'Connected to radio', out)
assert re.search('Aborting', out, re.MULTILINE)
@@ -327,7 +326,7 @@ def test_smoke1_seturl_invalid_url():
@pytest.mark.smoke1
def test_smoke1_configure():
"""Test --configure"""
return_value, out = subprocess.getstatusoutput(f"meshtastic --configure example_config.yaml")
_ , out = subprocess.getstatusoutput(f"meshtastic --configure example_config.yaml")
assert re.match(r'Connected to radio', out)
assert re.search('^Setting device owner to Bob TBeam', out, re.MULTILINE)
assert re.search('^Fixing altitude at 304 meters', out, re.MULTILINE)

View File

@@ -1,7 +1,4 @@
"""Meshtastic unit tests for node.py"""
import re
import subprocess
import platform
import pytest