Update CLI identity regression for captured reply routing

This commit is contained in:
mikecarper committed 2026-10-03 19:39:58 -07:00
1 parent a02554dd69
commit 4fca38363d
1 file changed
+9 -1
+9 -1
View File
@@ -190,7 +190,15 @@ class CompanionIdentityCliTests(unittest.TestCase):
framed = source[start:end]
self.assertIn('handled = handleCommand(text, 0, reply_buf);', framed)
self.assertIn('out_frame[0] = RESP_CODE_CLI_REPLY;', framed)
self.assertIn('_serial->writeFrame(out_frame, 1 + rlen);', framed)
# CLI setters may change transport ownership while they execute. The
# reply must use the captured requester and check complete admission.
capture = 'BaseSerialInterface* reply_route = _serial->captureReplyRoute();'
self.assertIn(capture, framed)
self.assertLess(framed.index(capture), framed.index('handleCommand(text, 0, reply_buf)'))
self.assertRegex(framed, r'_serial->writeFrameToRoute\(\s*'
r'reply_route,\s*out_frame,\s*1 \+ rlen\)\s*==\s*'
r'static_cast<size_t>\(1 \+ rlen\)')
self.assertNotIn('_serial->writeFrame(out_frame, 1 + rlen);', framed)
local = method(source, 'bool MyMesh::handleLocalControlCommand(')
branch = local[:local.index(' if (handleTxRoutingCommand(')]
self.assertIn('strcmp(command, "get public.key") == 0', branch)