Beispiel #1
0
    def test_sharedPrefix(self):
        args = ['prefix', 'prefixasdf', 'prefix', 'prefixxxx']
        self.assertEqual(sharedPrefix(args), 'prefix')

        args = ['p', 'prefixasdf', 'prefix', 'prefixxxx']
        self.assertEqual(sharedPrefix(args), 'p')

        args = ['one', 'two']
        self.assertEqual(sharedPrefix(args), '')

        args = ['hi']
        self.assertEqual(sharedPrefix(args), 'hi')
Beispiel #2
0
 def depth(self):
     vals = self.nodes.values()
     sp = sharedPrefix([bytesToBitString(n.id) for n in vals])
     return len(sp)
Beispiel #3
0
 def depth(self):
     sp = sharedPrefix([n.id for n in self.nodes.values()])
     return len(sp)
Beispiel #4
0
 def depth(self):
     sp = sharedPrefix([n.id for n in self.nodes.values()])
     return len(sp)