summaryrefslogtreecommitdiff
path: root/tests/unit/test_wxui_radiothread.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/test_wxui_radiothread.py')
-rw-r--r--tests/unit/test_wxui_radiothread.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/unit/test_wxui_radiothread.py b/tests/unit/test_wxui_radiothread.py
index 9039ab4..0277034 100644
--- a/tests/unit/test_wxui_radiothread.py
+++ b/tests/unit/test_wxui_radiothread.py
@@ -16,6 +16,8 @@ sys.modules['chirp.wxui.developer'] = mock.MagicMock()
# These need to be imported after the above mock so that we don't require
# wx to be present for these tests
from tests.unit import base # noqa
+from chirp import chirp_common # noqa
+from chirp import directory # noqa
from chirp.wxui import clone # noqa
from chirp.wxui import config # noqa
from chirp.wxui import radiothread # noqa
@@ -156,6 +158,22 @@ class TestClone(base.BaseTest):
[clone.port_label(p)
for p in sorted(ports, key=clone.port_sort_key)])
+ def test_detected_model_labels(self):
+ # Make sure all our detected model labels will be reasonable
+ # (and nonzero) in length. If the full label is too long, it will not
+ # be visible in the model box.
+ for rclass in [x for x in directory.DRV_TO_RADIO.values()
+ if issubclass(x, chirp_common.DetectableInterface)]:
+ labels = []
+ for child_rclass in rclass.detected_models(include_self=False):
+ label = clone.detected_value(rclass, child_rclass)
+ self.assertNotEqual('', label)
+ labels.append(label)
+ if labels:
+ label = '%s (+ %s)' % (rclass.MODEL, ','.join(labels))
+ self.assertLessEqual(len(label), 32,
+ 'Label %r is too long' % label)
+
class TestException(Exception):
pass