add simple unit test

This commit is contained in:
Mike Kinney committed 2021-12-01 00:13:57 -08:00
1 parent ee8c124651
commit 0473820ef4
5 files changed
+22 -1

No files matched your search

+4
View File
@@ -169,3 +169,7 @@ To test, first install this code locally, then run pytest:
pip3 install .
pytest
```
Possible options for testing:
* for more verbosity, add "-v" or even "-vv" like this: pytest -vv
* to run just unit tests: pytest -munit
* to run just integrstion tests: pytest -mint
Binary file not shown.
File renamed without changes.
+16
View File
@@ -0,0 +1,16 @@
"""Meshtastic unit tests for node.py"""
import re
import subprocess
import platform
import pytest
from meshtastic.node import pskToString
@pytest.mark.unit
def test_pskToString():
"""Test pskToString"""
assert pskToString('') == 'unencrypted'
assert pskToString(bytes([0x00])) == 'unencrypted'
assert pskToString(bytes([0x01])) == 'default'
assert pskToString(bytes([0x02, 0x01])) == 'secret'
+2 -1
View File
@@ -1,4 +1,5 @@
[pytest]
markers =
int: marks tests as integration
unit: marks tests as unit tests
int: marks tests as integration tests