diff options
| author | Dave Hibberd <hibby@debian.org> | 2025-05-04 23:46:09 +0100 |
|---|---|---|
| committer | Dave Hibberd <hibby@debian.org> | 2025-05-04 23:46:09 +0100 |
| commit | 812534848086446daa2e57bf2ec8db45e82fea18 (patch) | |
| tree | 0ab5d2a7c06f656465a648d72e3fbaa0349c5e78 /tests | |
| parent | f6b2e6e7159906b8b3204dca3a9e58e42c36ccbb (diff) | |
New upstream version 20250502upstream/20250502
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/__pycache__/test_edges.cpython-310-pytest-7.1.3.pyc | bin | 7719 -> 8059 bytes | |||
| -rw-r--r-- | tests/images/Baofeng_K6.img | bin | 0 -> 33965 bytes | |||
| -rw-r--r-- | tests/images/Icom_IC-T10.img | bin | 0 -> 6065 bytes | |||
| -rw-r--r-- | tests/images/QYT_KT-5000.img | bin | 0 -> 16569 bytes | |||
| -rw-r--r-- | tests/images/Wouxun_KG-805G.img | bin | 0 -> 8373 bytes | |||
| -rw-r--r-- | tests/images/Wouxun_KG-935H.img | bin | 0 -> 32949 bytes | |||
| -rw-r--r-- | tests/py3-untested-drivers.txt | 2 | ||||
| -rw-r--r-- | tests/py3_driver_testers.txt | 1 | ||||
| -rw-r--r-- | tests/test_edges.py | 9 | ||||
| -rw-r--r-- | tests/unit/__pycache__/test_chirp_common.cpython-310-pytest-7.1.3.pyc | bin | 31643 -> 33055 bytes | |||
| -rw-r--r-- | tests/unit/__pycache__/test_csv.cpython-310-pytest-7.1.3.pyc | bin | 10108 -> 11526 bytes | |||
| -rw-r--r-- | tests/unit/test_chirp_common.py | 10 | ||||
| -rw-r--r-- | tests/unit/test_csv.py | 21 |
13 files changed, 38 insertions, 5 deletions
diff --git a/tests/__pycache__/test_edges.cpython-310-pytest-7.1.3.pyc b/tests/__pycache__/test_edges.cpython-310-pytest-7.1.3.pyc Binary files differindex 47421f6..aaa4514 100644 --- a/tests/__pycache__/test_edges.cpython-310-pytest-7.1.3.pyc +++ b/tests/__pycache__/test_edges.cpython-310-pytest-7.1.3.pyc diff --git a/tests/images/Baofeng_K6.img b/tests/images/Baofeng_K6.img Binary files differnew file mode 100644 index 0000000..3309aec --- /dev/null +++ b/tests/images/Baofeng_K6.img diff --git a/tests/images/Icom_IC-T10.img b/tests/images/Icom_IC-T10.img Binary files differnew file mode 100644 index 0000000..23abac2 --- /dev/null +++ b/tests/images/Icom_IC-T10.img diff --git a/tests/images/QYT_KT-5000.img b/tests/images/QYT_KT-5000.img Binary files differnew file mode 100644 index 0000000..2fc7b1c --- /dev/null +++ b/tests/images/QYT_KT-5000.img diff --git a/tests/images/Wouxun_KG-805G.img b/tests/images/Wouxun_KG-805G.img Binary files differnew file mode 100644 index 0000000..967bde5 --- /dev/null +++ b/tests/images/Wouxun_KG-805G.img diff --git a/tests/images/Wouxun_KG-935H.img b/tests/images/Wouxun_KG-935H.img Binary files differnew file mode 100644 index 0000000..01cfbbd --- /dev/null +++ b/tests/images/Wouxun_KG-935H.img diff --git a/tests/py3-untested-drivers.txt b/tests/py3-untested-drivers.txt index ae81485..6d8ff38 100644 --- a/tests/py3-untested-drivers.txt +++ b/tests/py3-untested-drivers.txt @@ -1,6 +1,5 @@ # These drivers have not been converted (or confirmed working) for python3 ARRL_Travel_Plus -Baofeng_K5-Plus Baojie_BJ-9900 Baojie_BJ-UV55 Boblov_X3Plus @@ -36,7 +35,6 @@ Kenwood_TS-850 Puxing_PX-2R RT_Systems_CSV Sainsonic_AP510 -TYT_TH-350 TYT_TH-7800_File TYT_TH-9800_File TYT_TH-UV3R diff --git a/tests/py3_driver_testers.txt b/tests/py3_driver_testers.txt index 2925741..53bee81 100644 --- a/tests/py3_driver_testers.txt +++ b/tests/py3_driver_testers.txt @@ -375,6 +375,7 @@ Wouxun_KG-UV9G_Pro,@mrtjr1,25-Apr-2023 Wouxun_KG-UV9K,@mrtjr1,14-Apr-2023 Wouxun_KG-935G,@mrtjr1,4-Jan-2022 Wouxun_KG-935G_Plus,@mrtjr1,7-Feb-2023 +Wouxun_KG-935H,@mrtjr1,14-Mar-2025 Yaesu_FT-1500M,@f3sty,05-Dec-2022 Yaesu_FT-2800M,#10616,05-Jun-2023 Yaesu_FT-2900R_1900R,#10274,14-Jan-2023 diff --git a/tests/test_edges.py b/tests/test_edges.py index c5c0775..92498ff 100644 --- a/tests/test_edges.py +++ b/tests/test_edges.py @@ -3,11 +3,20 @@ from unittest import mock from chirp import bitwise from chirp import chirp_common +from chirp import directory from chirp import errors from tests import base class TestCaseEdges(base.DriverTest): + def test_inherits_from_registered(self): + if self.rf.has_sub_devices: + devs = self.radio.get_sub_devices() + else: + devs = [self.radio] + for dev in devs: + directory.registered_class(dev.__class__) + def test_longname(self): m = self.get_mem() m.name = ("X" * 256) # Should be longer than any radio can handle diff --git a/tests/unit/__pycache__/test_chirp_common.cpython-310-pytest-7.1.3.pyc b/tests/unit/__pycache__/test_chirp_common.cpython-310-pytest-7.1.3.pyc Binary files differindex 43d12a0..95787cc 100644 --- a/tests/unit/__pycache__/test_chirp_common.cpython-310-pytest-7.1.3.pyc +++ b/tests/unit/__pycache__/test_chirp_common.cpython-310-pytest-7.1.3.pyc diff --git a/tests/unit/__pycache__/test_csv.cpython-310-pytest-7.1.3.pyc b/tests/unit/__pycache__/test_csv.cpython-310-pytest-7.1.3.pyc Binary files differindex 3ba6d7a..64c8587 100644 --- a/tests/unit/__pycache__/test_csv.cpython-310-pytest-7.1.3.pyc +++ b/tests/unit/__pycache__/test_csv.cpython-310-pytest-7.1.3.pyc diff --git a/tests/unit/test_chirp_common.py b/tests/unit/test_chirp_common.py index facdbed..0edce51 100644 --- a/tests/unit/test_chirp_common.py +++ b/tests/unit/test_chirp_common.py @@ -504,7 +504,7 @@ class TestStepFunctions(base.BaseTest): 6.25: self._625, 12.5: self._125, } - allowed = [6.25, 12.5] + allowed = [12.5, 6.25] for step, freqs in list(steps.items()): for freq in freqs: # We don't support 5.0, so any of the frequencies in that @@ -520,7 +520,7 @@ class TestStepFunctions(base.BaseTest): def test_required_step_finds_suitable(self): # If we support 5.0, we should get it as the step for those self.assertEqual(5.0, chirp_common.required_step(self._005[0], - allowed=[2.5, 5.0])) + allowed=[5.0, 2.5])) # If we support 2.5 and not 5.0, then we should find 2.5 as a suitable # alternative self.assertEqual(2.5, chirp_common.required_step(self._005[0], @@ -534,7 +534,7 @@ class TestStepFunctions(base.BaseTest): def test_required_step_fail(self): self.assertRaises(errors.InvalidDataError, chirp_common.required_step, - 146520500) + 146520500, allowed=[5.0, 10.0, 12.5]) def test_fix_rounded_step_250(self): self.assertEqual(146106250, @@ -548,6 +548,10 @@ class TestStepFunctions(base.BaseTest): self.assertEqual(146118750, chirp_common.fix_rounded_step(146118000)) + def test_fix_rounded_step_no_change(self): + self.assertEqual(146520000, + chirp_common.fix_rounded_step(146520000)) + class TestImageMetadata(base.BaseTest): def test_make_metadata(self): diff --git a/tests/unit/test_csv.py b/tests/unit/test_csv.py index 60ee8cc..7974cec 100644 --- a/tests/unit/test_csv.py +++ b/tests/unit/test_csv.py @@ -28,6 +28,16 @@ CHIRP_CSV_MODERN_QUOTED_HEADER = ( 0,Nat Simplex,146.520000,,0.600000,TSQL,88.5,88.5,023,NN,023,Tone->Tone,FM,5.00,,50W,This is the national calling frequency on 2m,,,, 1,"National Simp",446.000000,-,5.000000,DTCS,88.5,88.5,023,NN,023,Tone->Tone,FM,5.00,,5.0W,This is NOT the UHF calling frequency,,,, """) # noqa +CHIRP_TSV = ( + """Location Name Frequency Duplex Offset Tone rToneFreq cToneFreq DtcsCode DtcsPolarity RxDtcsCode CrossMode Mode TStep Skip Power Comment URCALL RPT1CALL RPT2CALL DVCODE +8 Mt Scott 147.280000 + 0.600000 TSQL 88.5 167.9 023 NN 023 Tone->Tone FM 5.00 50W TayDan Emergency Step #2\t\t\t\t +9 Mt Tabor 145.390000 - 0.600000 TSQL 88.5 100.0 023 NN 023 Tone->Tone FM 5.00 50W TayDan Emergency Step #1\t\t\t\t +10 Timberline V 147.120000 + 0.600000 TSQL 103.5 100.0 023 NN 023 Tone->Tone FM 5.00 50W TayDan Emergency Step #4\t\t\t\t +11 Timberline U 444.225000 + 5.000000 TSQL 88.5 100.0 023 NN 023 Tone->Tone FM 5.00 50W K7RPT Timberline, Linked to VHF side, AC7QE-R echolink\t\t\t\t +12 GovtCamp 443.875000 + 5.000000 TSQL 88.5 103.5 023 NN 023 Tone->Tone FM 5.00 50W\t\t\t\t +13 GoatMtn 443.700000 + 5.000000 TSQL 88.5 103.5 023 NN 023 Tone->Tone FM 5.00 50W SW Corner of Clackamas, Co.\t\t\t\t +14 TyghRdge 147.260000 + 0.600000 TSQL 103.5 82.5 023 NN 023 Tone->Tone FM 5.00 50W\t\t\t\t +""") # noqa class TestCSV(unittest.TestCase): @@ -182,6 +192,7 @@ class TestCSV(unittest.TestCase): def test_escaped_string_chars(self): m = chirp_common.Memory() + m.freq = 146520000 m.number = 1 m.name = 'This is "The one"' m.comment = 'Wow, a \nMulti-line comment!' @@ -191,6 +202,7 @@ class TestCSV(unittest.TestCase): def test_unicode_comment_chars(self): m = chirp_common.Memory() + m.freq = 146520000 m.number = 1 m.name = 'This is "The one"' m.comment = b'This is b\xc9\x90d news'.decode() @@ -200,6 +212,7 @@ class TestCSV(unittest.TestCase): def test_cross_dtcs(self): m = chirp_common.Memory() + m.freq = 146520000 m.number = 1 m.tmode = 'Cross' m.cross_mode = 'DTCS->DTCS' @@ -231,3 +244,11 @@ class RTCSV(unittest.TestCase): @ddt.data('ft3d', 'ftm400', 'ftm500') def test_sample_file(self, arg): self._test_open('rtcsv_%s.csv' % arg) + + +class TestTSV(unittest.TestCase): + def test_parse_tsv(self): + radio = generic_csv.TSVRadio(None) + radio.load_from(CHIRP_TSV) + m = radio.get_memory(8) + self.assertEqual('Mt Scott', m.name) |
