summaryrefslogtreecommitdiff
path: root/tests/unit/test_icom_clone.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_icom_clone.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_icom_clone.py')
-rw-r--r--tests/unit/test_icom_clone.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/tests/unit/test_icom_clone.py b/tests/unit/test_icom_clone.py
index 9ade954..49720d9 100644
--- a/tests/unit/test_icom_clone.py
+++ b/tests/unit/test_icom_clone.py
@@ -13,18 +13,18 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+import sys
+from tests import icom_clone_simulator
+from chirp import memmap
+from chirp.drivers import icw32
from builtins import bytes
import glob
import os
-import logging
import unittest
from chirp import directory
-directory.safe_import_drivers()
-from chirp.drivers import icf
-from chirp import memmap
-from tests import icom_clone_simulator
+directory.import_drivers()
class BaseIcomCloneTest():
@@ -50,7 +50,6 @@ class BaseIcomCloneTest():
elif data[end-16:end] == b'IcomCloneFormat3':
return 3
-
def test_sync_in(self):
test_file = self.IMAGE_FILE
self.load_from_test_image(test_file)
@@ -64,6 +63,11 @@ class BaseIcomCloneTest():
elif img_ver == 3:
self.assertEqual(b'IcomCloneFormat3', self.radio._mmap[-16:])
elif img_ver is None:
+ if isinstance(self.radio, icw32.ICW32ERadio):
+ # The IC-W32E does some unclean things with the image size to
+ # pass pre-metadata detection. It will fail here, so just
+ # skip it.
+ return
self.assertEqual(self.radio.get_memsize(), len(self.radio._mmap))
def test_sync_out(self):
@@ -97,7 +101,6 @@ class TestAdapterMeta(type):
test_file_glob = os.path.join(os.path.dirname(os.path.abspath(__file__)),
'..', 'images',
'Icom_*.img')
-import sys
for image_file in glob.glob(test_file_glob):
base, _ext = os.path.splitext(os.path.basename(image_file))
@@ -106,7 +109,7 @@ for image_file in glob.glob(test_file_glob):
except Exception:
continue
- if issubclass(radio, icf.IcomRawCloneModeRadio):
+ if radio._raw_frames:
# The simulator does not behave like a raw radio
continue