Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bmswens committed May 2, 2023
1 parent a5ea9fa commit cf71681
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions tests/test_db.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# built in
import os
import datetime
from unittest.mock import MagicMock

# 3rd party
from pubsub import pub
import pytest
from meshtastic.mesh_interface import MeshInterface

# custom
# add to os.sys.path so that we don't have to make a package
Expand Down Expand Up @@ -44,15 +46,15 @@ def test_rec_msg(self):
"decoded": {"payload": b"test"},
"rxTime": 2,
}
interface = {
"nodes": {
1: {
"user": {
"longName": "John"
}
interface = MagicMock(autospec=MeshInterface)
nodes = {
"1": {
"user": {
"longName": "John"
}
}
}
interface.nodes = nodes
db.onMessage(packet, interface, ":memory:")

def test_rec_position(self):
Expand Down

0 comments on commit cf71681

Please sign in to comment.