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

    self.assertFullTrie(t)

    self.assertEquals(42, t.pop(self._LONG_KEY))
    self.assertShortTrie(t)

    self.assertEquals(42, t.setdefault(self._SHORT_KEY, 24))
    self.assertShortTrie(t)

    t[self._SHORT_KEY] = 24
    self.assertShortTrie(t, 24)

    self.assertEquals(24, t.setdefault(self._LONG_KEY, 24))
    self.assertFullTrie(t, 24)

    del t[self._LONG_KEY]
    self.assertShortTrie(t, 24)

    self.assertEquals((self.KeyFromKey(self._SHORT_KEY), 24), t.popitem())
    self.assertEmptyTrie(t)
Basic trie tests.
dataset/ETHPy150Open google/pygtrie/test.py/TrieTestCase.DoTestBasics