class_docstr: Verify that we blow up if SC2 thinks we did something wrong.
code: def test_replay_a_replay(self):
      run_config = run_configs.get()
      with run_config.start(want_rgb=False) as controller:
          map_inst = maps.get("Flat64")
          map_data = map_inst.data(run_config)
          interface = sc_pb.InterfaceOptions(raw=True)
  
          # Play a quick game to generate a replay.
          create = sc_pb.RequestCreateGame(
              local_map=sc_pb.LocalMap(
                  map_path=map_inst.path, map_data=map_data
              )
          )
          create.player_setup.add(type=sc_pb.Participant)
          create.player_setup.add(
              type=sc_pb.Computer,
              race=sc_common.Terran,
              difficulty=sc_pb.VeryEasy,
          )
          join = sc_pb.RequestJoinGame(
              race=sc_common.Terran, options=interface
          )
  
          controller.create_game(create)
          controller.join_game(join)
          controller.step(100)
          obs = controller.observe()
          replay_data = controller.save_replay()
  
          # Run through the replay verifying that it finishes but wasn't recording
          # a replay.
          start_replay = sc_pb.RequestStartReplay(
              replay_data=replay_data,
              map_data=map_data,
              options=interface,
              observed_player_id=1,
          )
  
          controller.start_replay(start_replay)
          controller.step(1000)
          obs2 = controller.observe()
          self.assertEqual(
              obs.observation.game_loop, obs2.observation.game_loop
          )
          with self.assertRaises(protocol.ProtocolError):
              controller.save_replay()
  
file_path: pysc2/pysc2/tests/protocol_error_test.py
imports: from absl.testing import absltest
  from pysc2 import maps
  from pysc2 import run_configs
  from pysc2.lib import protocol
  from pysc2.lib import remote_controller
  from pysc2.tests import utils
  from s2clientprotocol import common_pb2
  from s2clientprotocol import sc2api_pb2
label_desc: Use image node_id 2 for calling the TestProtocolError obj's underlying member method code with example usage: obj.test_replay_a_replay() without return types