summaryrefslogtreecommitdiff
path: root/tests/unit/test_network_sources.py
diff options
context:
space:
mode:
authorDave Hibberd <d@vehibberd.com>2023-10-16 21:37:34 +0100
committerDave Hibberd <d@vehibberd.com>2023-10-16 21:37:34 +0100
commit96e7558ee5db759a7214cd451a3478f3b44f59a3 (patch)
treee673aa5fb96256d43311c0e9581a2d5c6141ace6 /tests/unit/test_network_sources.py
parenta289d9178e89abd7dc0fb29bdd6dedf3987b4f06 (diff)
parent91dbf844ad923e3c4bca1252dd104d8fc8ce5475 (diff)
Update upstream source from tag 'upstream/20231016'
Update to upstream version '20231016' with Debian dir cd57b3fbc431f25a1408f045533dcb7f7b9975c0
Diffstat (limited to 'tests/unit/test_network_sources.py')
-rw-r--r--tests/unit/test_network_sources.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/unit/test_network_sources.py b/tests/unit/test_network_sources.py
new file mode 100644
index 0000000..eb82c42
--- /dev/null
+++ b/tests/unit/test_network_sources.py
@@ -0,0 +1,28 @@
+import unittest
+from unittest import mock
+
+from chirp.sources import dmrmarc
+
+# Hopefully this will provide a sentinel and forcing function for
+# network sources when APIs stop working. Unfortunately, live queries
+# are more likely to add spurious failures into the tests, but time
+# will tell if it's worth it.
+
+
+class TestDMRMARC(unittest.TestCase):
+ def test_marc_works(self):
+ r = dmrmarc.DMRMARCRadio()
+ r.do_fetch(mock.MagicMock(), {'city': 'portland',
+ 'state': 'oregon',
+ 'country': ''})
+ f = r.get_features()
+
+ # Assert that we found some repeaters. If they all go away in
+ # Portland, this will break and we will need another target
+ self.assertGreater(f.memory_bounds[1], 2)
+
+ for i in range(*f.memory_bounds):
+ m = r.get_memory(i)
+ self.assertEqual('DMR', m.mode)
+ # Assume all DMR repeaters are above 100MHz
+ self.assertGreater(m.freq, 100000000)