예제 #1
0
 def test_commonprefix_full(self):
     pd = PrefixDict(abcd=None)
     self.assertEqual('abcd', pd.commonprefix('abcd'))
예제 #2
0
 def test_commonprefix_empty(self):
     pd = PrefixDict(abcd=None)
     self.assertEqual(b'', pd.commonprefix('efgh'))
예제 #3
0
 def test_commonprefix_half(self):
     pd = PrefixDict(abcd=None)
     self.assertEqual(b'ab', pd.commonprefix('abef'))
예제 #4
0
 def test_commonprefix_full(self):
     pd = PrefixDict(abcd=None)
     self.assertEqual('abcd', pd.commonprefix('abcd'))
예제 #5
0
 def test_commonprefix_half(self):
     pd = PrefixDict(abcd=None)
     self.assertEqual(b'ab', pd.commonprefix('abef'))
예제 #6
0
 def test_commonprefix_empty(self):
     pd = PrefixDict(abcd=None)
     self.assertEqual(b'', pd.commonprefix('efgh'))
 def commonsuffix(self, key):
     path = PrefixDict.commonprefix(self, key, restore_key=False)
     return path[::-1]
예제 #8
0
 def commonsuffix(self, key):
     path = PrefixDict.commonprefix(self, key, restore_key=False)
     return path[::-1]