diff options
| author | Dave Hibberd <d@vehibberd.com> | 2024-01-23 00:30:05 +0000 |
|---|---|---|
| committer | Dave Hibberd <d@vehibberd.com> | 2024-01-23 00:30:05 +0000 |
| commit | 691b1b410562075e0d76033f5c8ddaf1da7344d0 (patch) | |
| tree | f183304481dc93719dec8c121cd1280822b2da4e /tests/test_edges.py | |
| parent | aed54358fee5927f9b4913566d84b92255e08e12 (diff) | |
| parent | ac8027c43c9df4431092d633a06bd5bd92341247 (diff) | |
Merge branch 'upstream' into 'upstream'
New upstream version 1:20240117
See merge request debian-hamradio-team/chirp!5
Diffstat (limited to 'tests/test_edges.py')
| -rw-r--r-- | tests/test_edges.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/test_edges.py b/tests/test_edges.py index e515330..2280819 100644 --- a/tests/test_edges.py +++ b/tests/test_edges.py @@ -1,3 +1,7 @@ +import pytest +from unittest import mock + +from chirp import bitwise from chirp import chirp_common from chirp import errors from tests import base @@ -106,12 +110,21 @@ class TestCaseEdges(base.DriverTest): lo, hi = self.rf.memory_bounds for name in self.rf.valid_special_chans: m1 = self.radio.get_memory(name) + # Flip to non-empty, but only touch it if it's false because some + # radios have empty in the immutable set. + if m1.empty: + m1.empty = False try: del m1.extra except AttributeError: pass if m1.freq > 130000000 and m1.freq < 500000000: m1.freq += 5000 + elif m1.freq == 0: + # If the memory was empty before, we likely need to pick + # a valid frequency. Use the bottom of the first supported + # band. + m1.freq = self.rf.valid_bands[0][0] try: self.radio.set_memory(m1) except errors.RadioError: @@ -154,3 +167,23 @@ class TestCaseEdges(base.DriverTest): self.assertEqual(m2.name.rstrip(), m2.name, 'Radio set and returned a memory with trailing ' 'whitespace in the name') + + +class TestBitwiseStrict(base.DriverTest): + def setUp(self): + pass + + def _raise(self, message): + raise SyntaxError(message) + + @pytest.mark.xfail(strict=False) + @mock.patch.object(bitwise.Processor, 'assert_negative_seek', + side_effect=_raise) + def test_bitwise_negative_seek(self, mock_assert): + super().setUp() + + @pytest.mark.xfail(strict=False) + @mock.patch.object(bitwise.Processor, 'assert_unnecessary_seek', + side_effect=_raise) + def test_bitwise_unnecessary_seek(self, mock_assert): + super().setUp() |
