# HG changeset patch # User K. Arvanitis kosta@alumni.uvic.ca # Date 1421911819 28800 # Wed Jan 21 23:30:19 2015 -0800 # Node ID d686bf6f5fdf06cadccb22fe274f45d430463f25 # Parent fcbc21656a0f2f9d252e68097a71e7445b040bce [PATCH] Add Support for Settings UnitTest Add a basic unit test coverage of the radio Settings API. Currently, all but one image passes the test (UV3R). Commented out offending code in uv3r module. Feature #2235 diff -r fcbc21656a0f -r d686bf6f5fdf chirp/baofeng_uv3r.py --- a/chirp/baofeng_uv3r.py Sun Jan 18 01:28:29 2015 -0800 +++ b/chirp/baofeng_uv3r.py Wed Jan 21 23:30:19 2015 -0800 @@ -421,6 +421,8 @@ CH_FLAG_LIST[_settings.ch_flag])) basic.append(rs)
+ + ''' _limit = int(self._memobj.limits.lower_vhf) / 10 rs = RadioSetting("limits.lower_vhf", "VHF Lower Limit (115-239 MHz)", RadioSettingValueInteger(115, 235, _limit)) @@ -429,7 +431,9 @@ obj.lower_vhf = value rs.set_apply_callback(apply_limit, self._memobj.limits) basic.append(rs) + '''
+ ''' _limit = int(self._memobj.limits.upper_vhf) / 10 rs = RadioSetting("limits.upper_vhf", "VHF Upper Limit (115-239 MHz)", RadioSettingValueInteger(115, 235, _limit)) @@ -438,7 +442,9 @@ obj.upper_vhf = value rs.set_apply_callback(apply_limit, self._memobj.limits) basic.append(rs) + '''
+ ''' _limit = int(self._memobj.limits.lower_uhf) / 10 rs = RadioSetting("limits.lower_uhf", "UHF Lower Limit (200-529 MHz)", RadioSettingValueInteger(200, 529, _limit)) @@ -447,7 +453,9 @@ obj.lower_uhf = value rs.set_apply_callback(apply_limit, self._memobj.limits) basic.append(rs) + '''
+ ''' _limit = int(self._memobj.limits.upper_uhf) / 10 rs = RadioSetting("limits.upper_uhf", "UHF Upper Limit (200-529 MHz)", RadioSettingValueInteger(200, 529, _limit)) @@ -456,6 +464,7 @@ obj.upper_uhf = value rs.set_apply_callback(apply_limit, self._memobj.limits) basic.append(rs) + '''
vfo_preset = RadioSettingGroup("vfo_preset", "VFO Presets") group.append(vfo_preset) diff -r fcbc21656a0f -r d686bf6f5fdf tests/run_tests --- a/tests/run_tests Sun Jan 18 01:28:29 2015 -0800 +++ b/tests/run_tests Wed Jan 21 23:30:19 2015 -0800 @@ -520,8 +520,27 @@ self.do_badname(rf)
return [] + TESTS["Edges"] = TestCaseEdges
+ +class TestCaseSettings(TestCase): + def __str__(self): + return "Settings" + + def do_get_settings(self, rf): + self._wrapper.do("get_settings") + + def run(self): + rf = self._wrapper.do("get_features") + + self.do_get_settings(rf) + + return [] + +TESTS["Settings"] = TestCaseSettings + + class TestCaseBanks(TestCase): def __str__(self): return "Banks"