mirror of
https://github.com/craigerl/aprsd.git
synced 2025-05-29 12:42:28 -04:00
Fixed version unit tests
This commit is contained in:
parent
7b019d24f0
commit
23c219f0d2
@ -15,6 +15,7 @@ class APRSDStats:
|
|||||||
config = None
|
config = None
|
||||||
|
|
||||||
start_time = None
|
start_time = None
|
||||||
|
_aprsis_server = None
|
||||||
_aprsis_keepalive = None
|
_aprsis_keepalive = None
|
||||||
|
|
||||||
_msgs_tracked = 0
|
_msgs_tracked = 0
|
||||||
|
@ -2,7 +2,7 @@ import unittest
|
|||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
import aprsd
|
import aprsd
|
||||||
from aprsd import messaging
|
from aprsd import messaging, stats, utils
|
||||||
from aprsd.fuzzyclock import fuzzy
|
from aprsd.fuzzyclock import fuzzy
|
||||||
from aprsd.plugins import fortune as fortune_plugin
|
from aprsd.plugins import fortune as fortune_plugin
|
||||||
from aprsd.plugins import ping as ping_plugin
|
from aprsd.plugins import ping as ping_plugin
|
||||||
@ -16,7 +16,10 @@ class TestPlugin(unittest.TestCase):
|
|||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.fromcall = "KFART"
|
self.fromcall = "KFART"
|
||||||
self.ack = 1
|
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")
|
@mock.patch("shutil.which")
|
||||||
def test_fortune_fail(self, mock_which):
|
def test_fortune_fail(self, mock_which):
|
||||||
@ -141,7 +144,7 @@ class TestPlugin(unittest.TestCase):
|
|||||||
self.assertEqual(expected, actual)
|
self.assertEqual(expected, actual)
|
||||||
|
|
||||||
def test_version(self):
|
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)
|
version = version_plugin.VersionPlugin(self.config)
|
||||||
|
|
||||||
fromcall = "KFART"
|
fromcall = "KFART"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user