# Path: pysc2/lib/proto_diff.py
# _ARRAY_PLACEHOLDER = "*"
# class ProtoPath(object):
# class ProtoDiffs(object):
#   def __init__(self, path):
#   def get_field(self, proto):
#   def with_anonymous_array_indices(self):
#   def path(self):
#   def __lt__(self, other):
#   def __getitem__(self, item):
#   def __len__(self):
#   def __eq__(self, o):
#   def __hash__(self):
#   def __repr__(self):
#   def __init__(self, proto_a, proto_b, changed, added, removed):
#   def proto_a(self):
#   def proto_b(self):
#   def changed(self):
#   def added(self):
#   def removed(self):
#   def all_diffs(self):
#   def report(self, differencers=None, truncate_to=0):
#   def __repr__(self):
# def _truncate(val, truncate_to):
# def _dict_path_to_proto_path(dict_path):
# def compute_diff(proto_a, proto_b):


from absl.testing import absltest
from pysc2.lib import proto_diff
from s2clientprotocol import sc2api_pb2 as sc_pb
from s2clientprotocol import score_pb2
        proto_diff.ProtoPath(("observation", "actions", 1)),
        proto_diff.ProtoPath(("observation", "actions", 1, "target")))

    self.assertGreater(
        proto_diff.ProtoPath(("observation", "actions", 1)),
        proto_diff.ProtoPath(("observation",)))

  def testEquals(self):
    a = proto_diff.ProtoPath(("observation", "actions", 1))
    b = proto_diff.ProtoPath(("observation", "actions", 1))
    self.assertEqual(a, b)
    self.assertEqual(hash(a), hash(b))

  def testNotEqual(self):
    a = proto_diff.ProtoPath(("observation", "actions", 1))
    b = proto_diff.ProtoPath(("observation", "actions", 2))
    self.assertNotEqual(a, b)
    self.assertNotEqual(hash(a), hash(b))

  def testIndexing(self):
    path = proto_diff.ProtoPath(("observation", "actions", 1))
    self.assertEqual(path[0], "observation")
    self.assertEqual(path[1], "actions")
    self.assertEqual(path[-2], "actions")
    self.assertEqual(path[-1], 1)

  def testGetField(self):
    proto = sc_pb.ResponseObservation(
        observation=sc_pb.Observation(game_loop=1, alerts=[sc_pb.AlertError]))


# Path: pysc2/lib/proto_diff.py
# _ARRAY_PLACEHOLDER = "*"
# class ProtoPath(object):
# class ProtoDiffs(object):
#   def __init__(self, path):
#   def get_field(self, proto):
#   def with_anonymous_array_indices(self):
#   def path(self):
#   def __lt__(self, other):
#   def __getitem__(self, item):
#   def __len__(self):
#   def __eq__(self, o):
#   def __hash__(self):
#   def __repr__(self):
#   def __init__(self, proto_a, proto_b, changed, added, removed):
#   def proto_a(self):
#   def proto_b(self):
#   def changed(self):
#   def added(self):
#   def removed(self):
#   def all_diffs(self):
#   def report(self, differencers=None, truncate_to=0):
#   def __repr__(self):
# def _truncate(val, truncate_to):
# def _dict_path_to_proto_path(dict_path):
# def compute_diff(proto_a, proto_b):


# Path: pysc2/lib/proto_diff_test.py
from absl.testing import absltest
from pysc2.lib import proto_diff
from s2clientprotocol import sc2api_pb2 as sc_pb
from s2clientprotocol import score_pb2

        proto_diff.ProtoPath(("observation", "actions", 1)),
        proto_diff.ProtoPath(("observation", "actions", 1, "target")))

    self.assertGreater(
        proto_diff.ProtoPath(("observation", "actions", 1)),
        proto_diff.ProtoPath(("observation",)))

  def testEquals(self):
    a = proto_diff.ProtoPath(("observation", "actions", 1))
    b = proto_diff.ProtoPath(("observation", "actions", 1))
    self.assertEqual(a, b)
    self.assertEqual(hash(a), hash(b))

  def testNotEqual(self):
    a = proto_diff.ProtoPath(("observation", "actions", 1))
    b = proto_diff.ProtoPath(("observation", "actions", 2))
    self.assertNotEqual(a, b)
    self.assertNotEqual(hash(a), hash(b))

  def testIndexing(self):
    path = proto_diff.ProtoPath(("observation", "actions", 1))
    self.assertEqual(path[0], "observation")
    self.assertEqual(path[1], "actions")
    self.assertEqual(path[-2], "actions")
    self.assertEqual(path[-1], 1)

  def testGetField(self):
    proto = sc_pb.ResponseObservation(
        observation=sc_pb.Observation(game_loop=1, alerts=[sc_pb.AlertError]))


    game_loop = proto_diff.ProtoPath(("observation", "game_loop"))