diff options
| author | Dave Hibberd <hibby@debian.org> | 2026-10-31 12:31:46 +0000 |
|---|---|---|
| committer | Dave Hibberd <hibby@debian.org> | 2026-10-31 12:31:46 +0000 |
| commit | dd07cc494d2f8a342ee0556a593b068800f9da5b (patch) | |
| tree | 07f455fe694b4a47959b76e9f93c0306690bc6a2 /tests/test_setting_docs.py | |
| parent | aa0d17d5ad14d671e5ce02cb90f814e0a96fad98 (diff) | |
| parent | ef0af95bac2c3d310fe55f54853904395b57f884 (diff) | |
Update upstream source from tag 'upstream/20261030'
Update to upstream version '20261030'
with Debian dir 82dda47c52fda693a8e3b8228e4043c187b8dcfc
Diffstat (limited to 'tests/test_setting_docs.py')
| -rw-r--r-- | tests/test_setting_docs.py | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/test_setting_docs.py b/tests/test_setting_docs.py new file mode 100644 index 0000000..6fb3789 --- /dev/null +++ b/tests/test_setting_docs.py @@ -0,0 +1,41 @@ +import os + +import yaml + +from chirp import directory +from chirp import settings +from tests import base + +with open(os.path.join(os.path.dirname(__file__), + 'driver_setting_docs.yaml')) as f: + DOCUMENTED = yaml.load(f, Loader=yaml.SafeLoader) or [] + + +class TestCaseSettingDocs(base.DriverTest): + def setUp(self): + # Most radios are not listed, so skip them before loading the image + if (self.SUB_DEVICE is None and + directory.radio_class_id(self.RADIO_CLASS) not in DOCUMENTED): + self.skipTest('Not listed in driver_setting_docs.yaml') + super().setUp() + + def test_settings_have_docs(self): + if directory.radio_class_id(self.radio.__class__) not in DOCUMENTED: + self.skipTest('Not listed in driver_setting_docs.yaml') + + all_settings = [] + if self.rf.has_settings: + all_settings.extend(self.radio.get_settings().walk()) + for i in range(*self.rf.memory_bounds): + mem = self.radio.get_memory(i) + if not mem.empty: + extra = mem.extra + if isinstance(extra, settings.RadioSettingGroup): + extra = extra.walk() + all_settings.extend(extra) + break + + missing = [setting.get_name() for setting in all_settings + if not setting.__doc__] + self.assertEqual([], missing, + 'Settings without a description') |
