Ejemplo n.º 1
0
 def test_find_previous_loopstart_exception(self):
     instructions = ['DO ATTACK', 'DO ATTACK', 'DO ATTACK', 'LOOP END']
     code_runner = CodeRunner([])
     with self.assertRaises(RobotException) as context:
         code_runner._find_previous_loopstart(instructions, 3)
     self.assertTrue("LOOP START not found for LOOP END at 3" in context.exception)
Ejemplo n.º 2
0
 def test_find_previous_loopstart2(self):
     instructions = ['DO ATTACK', 'LOOP START', 'DO ATTACK', 'DO ATTACK', 'LOOP END']
     code_runner = CodeRunner([])
     prev_loopstart = code_runner._find_previous_loopstart(instructions, 3)
     self.assertEqual(1, prev_loopstart)