From cf716815dea914071a9494d978de8d4591f612d7 Mon Sep 17 00:00:00 2001 From: Brandon Swenson Date: Tue, 2 May 2023 01:32:55 -0700 Subject: [PATCH] update tests --- tests/test_db.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/test_db.py b/tests/test_db.py index 74b1b18..d4b0fb2 100644 --- a/tests/test_db.py +++ b/tests/test_db.py @@ -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 @@ -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):