mirror of
https://github.com/meshtastic/python.git
synced 2026-04-29 03:13:56 -04:00
had to move test dir to tests because of pytest looking for __init__.py
This commit is contained in:
23
meshtastic/tests/test_mesh_interface.py
Normal file
23
meshtastic/tests/test_mesh_interface.py
Normal 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()
|
||||
Reference in New Issue
Block a user