summaryrefslogtreecommitdiff
path: root/tests/unit/test_bandplan.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_bandplan.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_bandplan.py')
-rw-r--r--tests/unit/test_bandplan.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/unit/test_bandplan.py b/tests/unit/test_bandplan.py
new file mode 100644
index 0000000..c6fd920
--- /dev/null
+++ b/tests/unit/test_bandplan.py
@@ -0,0 +1,33 @@
+import unittest
+
+from chirp import bandplan
+
+
+class FakeConfig:
+ def __init__(self, bandplan):
+ self.bandplan = bandplan
+
+ def is_defined(self, opt, sec):
+ return True
+
+ def get(self, opt, sec):
+ return None
+
+ def get_bool(self, opt, sec):
+ return opt == self.bandplan
+
+
+class BandPlanTest(unittest.TestCase):
+ def test_get_repeater_bands(self):
+ plans = bandplan.BandPlans(FakeConfig('north_america'))
+ expected = ['10 Meter Band',
+ '6 Meter Band',
+ '2 Meter Band',
+ '1.25 Meter Band',
+ '70 Centimeter Band',
+ '33 Centimeter Band',
+ '23 Centimeter Band',
+ '13 Centimeter Band']
+
+ self.assertEqual(expected,
+ [b.name for b in plans.get_repeater_bands()])