Support bounded machine instruction step counts in MCP
This commit is contained in:
@@ -55,6 +55,16 @@ class McpAdapterTests(unittest.TestCase):
|
||||
self.client.step_source('back')
|
||||
self.assertEqual(len(self.calls), before)
|
||||
|
||||
def test_machine_step_count_is_validated_before_rpc(self):
|
||||
before = len(self.calls)
|
||||
for count in (0, 65, True):
|
||||
with self.assertRaisesRegex(SessionError, '1..64'):
|
||||
self.client.step_instruction(count)
|
||||
self.assertEqual(len(self.calls), before)
|
||||
self.client.step_instruction(3)
|
||||
self.assertEqual(self.calls[-1][1], 'step')
|
||||
self.assertEqual(self.calls[-1][2]['count'], 3)
|
||||
|
||||
def test_press_key_releases_shift_after_snapshot_error(self):
|
||||
calls = []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user