test: uci delete support in health test fake

This commit is contained in:
2026-08-18 20:47:54 -05:00
parent b5d9ed39ff
commit 4c5b459f72
+4
View File
@@ -35,6 +35,10 @@ class HealthCheckTest(unittest.TestCase):
if a[:2] == ['uci', 'set']:
k, _, v = a[2].partition('=')
self.uci_state[k] = v
if a[:2] == ['uci', 'delete']:
for k in list(self.uci_state):
if k == a[2] or k.startswith(a[2] + '.'):
del self.uci_state[k]
if a[:2] == ['uci', 'get']:
return (0, self.uci_state.get(a[2], '') + '\n', '')
if a[0] == 'uci' and a[1] == 'show':