had to move test dir to tests because of pytest looking for __init__.py

This commit is contained in:
Mike Kinney
2021-12-09 17:20:13 -08:00
parent 7ea6a85c31
commit 80d13eac85
16 changed files with 85 additions and 23 deletions

View File

@@ -0,0 +1,23 @@
"""Meshtastic unit tests for mesh_interface.py"""
import re
import pytest
from ..mesh_interface import MeshInterface
@pytest.mark.unit
def test_MeshInterface(capsys):
"""Test that we can instantiate a MeshInterface"""
iface = MeshInterface(noProto=True)
iface.showInfo()
iface.localNode.showInfo()
out, err = capsys.readouterr()
assert re.search(r'Owner: None \(None\)', out, re.MULTILINE)
assert re.search(r'Nodes', out, re.MULTILINE)
assert re.search(r'Preferences', out, re.MULTILINE)
assert re.search(r'Channels', out, re.MULTILINE)
assert re.search(r'Primary channel URL', out, re.MULTILINE)
assert err == ''
iface.close()