File: test_bandplan.py

package info (click to toggle)
chirp 1%3A20251108-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 18,728 kB
  • sloc: python: 156,369; ansic: 296; sh: 219; xml: 24; makefile: 19
file content (33 lines) | stat: -rw-r--r-- 876 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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()])