code: def test_hallucination(self):
      self.god()
  
      # Create some sentries.
      self.create_unit(
          unit_type=units.Protoss.Sentry, owner=1, pos=(30, 30)
      )
      self.create_unit(
          unit_type=units.Protoss.Sentry, owner=2, pos=(30, 28)
      )
  
      self.step()
      obs = self.observe()
  
      # Give one enough energy.
      tag = utils.get_unit(
          obs[0], unit_type=units.Protoss.Sentry, owner=1
      ).tag
      self.debug(
          unit_value=sc_debug.DebugSetUnitValue(
              unit_value=sc_debug.DebugSetUnitValue.Energy,
              value=200,
              unit_tag=tag,
          )
      )
  
      self.step()
      obs = self.observe()
  
      # Create a hallucinated archon.
      self.raw_unit_command(0, "Hallucination_Archon_quick", tag)
  
      self.step()
      obs = self.observe()
  
      # Verify the owner knows it's a hallucination, but the opponent doesn't.
      p1 = utils.get_unit(obs[0], unit_type=units.Protoss.Archon)
      p2 = utils.get_unit(obs[1], unit_type=units.Protoss.Archon)
      self.assertTrue(p1.is_hallucination)
      self.assertFalse(p2.is_hallucination)
  
      # Create an observer so the opponent has detection.
      self.create_unit(
          unit_type=units.Protoss.Observer, owner=2, pos=(28, 30)
      )
  
      self.step()
      obs = self.observe()
  
      # Verify the opponent now also knows it's a hallucination.
      p1 = utils.get_unit(obs[0], unit_type=units.Protoss.Archon)
      p2 = utils.get_unit(obs[1], unit_type=units.Protoss.Archon)
      self.assertTrue(p1.is_hallucination)
      self.assertTrue(p2.is_hallucination)
  
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 1 for calling the ObsTest obj's underlying member method code with example usage: obj.test_hallucination() without return types