Add shared-session MCP source debugger adapter
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user