code: def test_action_delay(self):
      self.observe()
      self.create_unit(
          unit_type=units.Protoss.Zealot, owner=1, pos=(32, 32)
      )
  
      self.step(16)
      obs1 = self.observe()
      self.assertLen(obs1[0].actions, 0)
  
      zealot1 = utils.get_unit(
          obs1[0], unit_type=units.Protoss.Zealot, owner=1
      )
      self.assertLen(zealot1.orders, 0)
  
      self.raw_unit_command(0, "Move_screen", zealot1.tag, (30, 30))
  
      # If the delay is taken down to 1, remove this first step of verifying the
      # actions length is 0.
      self.assertEqual(EXPECTED_ACTION_DELAY, 2)
  
      self.step(1)
      obs2 = self.observe()
      self.assertLen(obs2[0].action_errors, 0)
      self.assertLen(obs2[0].actions, 0)
  
      self.step(1)
      obs2 = self.observe()
      self.assertLen(obs2[0].action_errors, 0)
      self.assertGreaterEqual(len(obs2[0].actions), 1)
      for action in obs2[0].actions:
          if action.HasField("action_raw"):
              break
      else:
          self.assertFalse("No raw action found")
  
      self.assertEqual(
          action.game_loop, obs1[0].observation.game_loop + 1
      )  # pylint: disable=undefined-loop-variable
      unit_command = (
          action.action_raw.unit_command
      )  # pylint: disable=undefined-loop-variable
      self.assertEqual(
          unit_command.ability_id,
          actions.FUNCTIONS.Move_Move_screen.ability_id,
      )
      self.assert_point(unit_command.target_world_space_pos, (30, 30))
      self.assertEqual(unit_command.unit_tags[0], zealot1.tag)
  
      zealot2 = utils.get_unit(
          obs2[0], unit_type=units.Protoss.Zealot, owner=1
      )
      self.assertLen(zealot2.orders, 1)
      self.assertEqual(
          zealot2.orders[0].ability_id,
          actions.FUNCTIONS.Move_Move_screen.ability_id,
      )
      self.assert_point(
          zealot2.orders[0].target_world_space_pos, (30, 30)
      )
  
file_path: pysc2/pysc2/tests/obs_test.py
imports: from absl.testing import absltest
  from pysc2.lib import actions
  from pysc2.lib import buffs
  from pysc2.lib import features
  from pysc2.lib import units
  from pysc2.tests import utils
  from s2clientprotocol import debug_pb2
  from s2clientprotocol import raw_pb2
label_desc: Use image node_id 9 for calling the ObsTest obj's underlying member method code with example usage: obj.test_action_delay() without return types