def testEquality(self):
    d = dict.fromkeys((self._SHORT_KEY, self._LONG_KEY), 42)
    # pylint: disable=redefined-outer-name
    tries = [factory(self._TRIE_CLS, d) for _, factory in _TRIE_FACTORIES]

    for i in range(1, len(tries)):
      self.assertEquals(tries[i-1], tries[i],
                        '%r (factory: %s) should equal %r (factory: %s)' %
                        (tries[i-1], _TRIE_FACTORIES[i-1][0],
                         tries[i], _TRIE_FACTORIES[i][0]))

    for i in range(1, len(tries)):
      tries[i-1][self._OTHER_KEY] = 42
      self.assertNotEquals(
          tries[i-1], tries[i],
          '%r (factory: %s) should not be equal %r (factory: %s)' %
          (tries[i-1], _TRIE_FACTORIES[i-1][0],
           tries[i], _TRIE_FACTORIES[i][0]))
Tests equality comparison.
dataset/ETHPy150Open google/pygtrie/test.py/TrieTestCase.testEquality