[chirp_devel] [uvr50] New model: Quansheng UV-R50 (fixes #6129)
Hi all,
The attached patch adds support for Quansheng UV-R50 radios as requested in #6129. I've added support for all documented options.
I hit a small issue in TestCopyAll as one of the test cases involves a channel with a name containing spaces, and this radio doesn't know how to encode a space in a channel name as far as I can tell, so I added support in that test to ignore this narrow class of failures. I'm happy to change for another approach if it is preferred.
As others on the list have noted, I had to rm tests/images/Puxing_PX-777.img to make tests pass, but that failure seems unrelated to my changes. Without that file, all tox tests pass.
Per guidelines I'm attaching Quansheng_UV-R50.img at https://chirp.danplanet.com/issues/6129
Full commit message:
""" [uvr50] New model: Quansheng UV-R50 (fixes #6129)
* Adds support for Quansheng UV-R50 radios. * This may or may not support all UV-R50 radios, I only have one model to try it with and information on variants is scarce. * This supports all options documented in the manual. * Fix TestCopyAll to not fail radios that don't support certain characters in channel names, since this one doesn't do spaces. """
Best,
I hit a small issue in TestCopyAll as one of the test cases involves a channel with a name containing spaces, and this radio doesn't know how to encode a space in a channel name as far as I can tell, so I added support in that test to ignore this narrow class of failures. I'm happy to change for another approach if it is preferred.
Thanks, this is indeed a bug in the test, but I think we should solve it a different way.
diff --git a/tests/run_tests.py b/tests/run_tests.py --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -306,8 +306,17 @@ self._wrapper.do("set_memory", dst_mem) ret_mem = self._wrapper.do("get_memory", dst_number)
# Some radios may not support all characters used in
# channel names in the test data. If that's the case,
# ignore the name field for this test entry.
ignore = None
for c in dst_mem.name:
if c not in dst_rf.valid_characters:
ignore = ['name']
break
try:
self.compare_mem(dst_mem, ret_mem)
self.compare_mem(dst_mem, ret_mem, ignore=ignore) except TestFailedError, e:
What you have here just makes us ignore any problems with the name, which may be more serious than just the spaces. Really, we should pre-filter the name in the source memory and expect that value instead. Can you do something like:
ret_mem.name = ''.join(x for x in ret_mem.name if x in dst_rf.valid_characters)
? Then we should get a valid result from compare_mem().
Thanks!
--Dan
participants (2)
-
Dan Smith
-
Uriel Corfa