test: health monitor uci-show fake
This commit is contained in:
@@ -37,6 +37,10 @@ class HealthCheckTest(unittest.TestCase):
|
|||||||
self.uci_state[k] = v
|
self.uci_state[k] = v
|
||||||
if a[:2] == ['uci', 'get']:
|
if a[:2] == ['uci', 'get']:
|
||||||
return (0, self.uci_state.get(a[2], '') + '\n', '')
|
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, '', '')
|
return (0, '', '')
|
||||||
|
|
||||||
server.device_run = fake_run
|
server.device_run = fake_run
|
||||||
|
|||||||
Reference in New Issue
Block a user