def test_commonprefix_full(self): pd = PrefixDict(abcd=None) self.assertEqual('abcd', pd.commonprefix('abcd'))
def test_commonprefix_empty(self): pd = PrefixDict(abcd=None) self.assertEqual(b'', pd.commonprefix('efgh'))
def test_commonprefix_half(self): pd = PrefixDict(abcd=None) self.assertEqual(b'ab', pd.commonprefix('abef'))
def commonsuffix(self, key): path = PrefixDict.commonprefix(self, key, restore_key=False) return path[::-1]