test: health monitor uci-show fake

This commit is contained in:
2026-08-18 19:32:56 -05:00
parent a4285496fb
commit 1d063695fa
+4
View File
@@ -37,6 +37,10 @@ class HealthCheckTest(unittest.TestCase):
self.uci_state[k] = v
if a[:2] == ['uci', 'get']:
return (0, self.uci_state.get(a[2], '') + '\n', '')
if a[0] == 'uci' and a[1] == 'show':
sec = a[2]
return (0, ''.join("%s=%s\n" % (k, v) for k, v in self.uci_state.items()
if k == sec or k.startswith(sec + '.')), '')
return (0, '', '')
server.device_run = fake_run