summaryrefslogtreecommitdiff
path: root/tests/test_edges.py
diff options
context:
space:
mode:
authorYogeswaran Umasankar <kd8mbd@gmail.com>2024-01-20 20:25:00 +0000
committerYogeswaran Umasankar <kd8mbd@gmail.com>2024-01-20 20:25:00 +0000
commite5ac17f663e108f458b5e3d34bfcc85b2d0482bc (patch)
tree13f52b05b717ade7f8ba982ee1d910834067c0c6 /tests/test_edges.py
parentf5e142a4e54bfda24bec40e923c643b434948a04 (diff)
parentac8027c43c9df4431092d633a06bd5bd92341247 (diff)
Update upstream source from tag 'upstream/1%20240117'
Update to upstream version '1:20240117' with Debian dir 8d8fe4e002b178241b01b8f9b69615aa2480698f
Diffstat (limited to 'tests/test_edges.py')
-rw-r--r--tests/test_edges.py33
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()