diff options
| author | Dave Hibberd <d@vehibberd.com> | 2023-10-16 21:37:27 +0100 |
|---|---|---|
| committer | Dave Hibberd <d@vehibberd.com> | 2023-10-16 21:37:27 +0100 |
| commit | 91dbf844ad923e3c4bca1252dd104d8fc8ce5475 (patch) | |
| tree | 93c4db659daf278db034b304e4cd910454504ec1 /tests/unit/test_icom_clone.py | |
| parent | 6f19923a918f7fb63a444b0c99950fdbe9d2f74c (diff) | |
New upstream version 20231016upstream/20231016
Diffstat (limited to 'tests/unit/test_icom_clone.py')
| -rw-r--r-- | tests/unit/test_icom_clone.py | 19 |
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 |
