From 23c219f0d2ef4ac0c65d22ac9810b5a30d99b251 Mon Sep 17 00:00:00 2001 From: Hemna Date: Mon, 5 Apr 2021 08:55:46 -0400 Subject: [PATCH] Fixed version unit tests --- aprsd/stats.py | 1 + tests/test_plugin.py | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/aprsd/stats.py b/aprsd/stats.py index a8c3a4e..f498601 100644 --- a/aprsd/stats.py +++ b/aprsd/stats.py @@ -15,6 +15,7 @@ class APRSDStats: config = None start_time = None + _aprsis_server = None _aprsis_keepalive = None _msgs_tracked = 0 diff --git a/tests/test_plugin.py b/tests/test_plugin.py index 73fad4c..8baf6e9 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -2,7 +2,7 @@ import unittest from unittest import mock import aprsd -from aprsd import messaging +from aprsd import messaging, stats, utils from aprsd.fuzzyclock import fuzzy from aprsd.plugins import fortune as fortune_plugin from aprsd.plugins import ping as ping_plugin @@ -16,7 +16,10 @@ class TestPlugin(unittest.TestCase): def setUp(self): self.fromcall = "KFART" self.ack = 1 - self.config = {"ham": {"callsign": self.fromcall}} + self.config = utils.DEFAULT_CONFIG_DICT + self.config["ham"]["callsign"] = self.fromcall + # Inintialize the stats object with the config + stats.APRSDStats(self.config) @mock.patch("shutil.which") def test_fortune_fail(self, mock_which): @@ -141,7 +144,7 @@ class TestPlugin(unittest.TestCase): self.assertEqual(expected, actual) def test_version(self): - expected = "APRSD version '{}'".format(aprsd.__version__) + expected = "APRSD ver:{} uptime:0:0:0".format(aprsd.__version__) version = version_plugin.VersionPlugin(self.config) fromcall = "KFART"