Add shared-session MCP source debugger adapter

This commit is contained in:
Александр Петров
2026-09-16 20:43:50 +03:00
parent addc00a0f3
commit 9ad5a018a2
19 changed files with 740 additions and 22 deletions
+19
View File
@@ -127,6 +127,25 @@ class SessionTests(unittest.TestCase):
bridge.calls)
session.clear_breakpoint(result['id'])
def test_partial_breakpoint_clear_retains_remaining_backend_id(self):
class FlakyBridge(FakeBridge):
failed = False
def request(self, command, **args):
if command == 'clear' and args['id'] == 11 and not self.failed:
self.failed = True
raise SessionError('временная ошибка удаления')
return super().request(command, **args)
bridge = FlakyBridge(self.memory)
session = DebugSession(self.model, bridge)
session.breakpoints[1] = [10, 11]
with self.assertRaisesRegex(SessionError, 'временная ошибка'):
session.clear_breakpoint(1)
self.assertEqual(session.breakpoints[1], [11])
self.assertEqual(session.clear_breakpoint(1)['backend_ids'], [11])
self.assertNotIn(1, session.breakpoints)
def test_stale_source_and_unmapped_bank_are_rejected(self):
session = DebugSession(self.model, FakeBridge(self.memory))
session.attach()