def DoTestSubtrieIterator(self, trie_factory):
    d = dict.fromkeys((self._SHORT_KEY, self._LONG_KEY), 42)
    t = trie_factory(self._TRIE_CLS, d)

    long_key = self.KeyFromKey(self._LONG_KEY)
    prefix = self._LONG_PREFIXES[0]

    self.assertEquals([42, 42], t.values(prefix=self._SHORT_KEY))
    self.assertEquals([42, 42], list(t.itervalues(prefix=self._SHORT_KEY)))
    self.assertEquals([42], t.values(prefix=prefix))
    self.assertEquals([42], list(t.itervalues(prefix=prefix)))

    expected_items = [(long_key, 42)]
    self.assertEquals(expected_items, sorted(t.items(prefix=prefix)))
    self.assertEquals(expected_items, sorted(t.iteritems(prefix=prefix)))

    self.assertEquals([long_key], sorted(t.keys(prefix=prefix)))
    self.assertEquals([long_key], sorted(t.iterkeys(prefix=prefix)))
Subtrie iterator tests.
dataset/ETHPy150Open google/pygtrie/test.py/TrieTestCase.DoTestSubtrieIterator