def test_commonprefix_full(self): pd = PrefixSet(['abcd']) self.assertEqual('abcd', pd.commonprefix('abcd'))
def test_commonprefix_half(self): pd = PrefixSet(['abcd']) self.assertEqual(b'ab', pd.commonprefix('abef'))
def test_commonprefix_empty(self): pd = PrefixSet(['abcd']) self.assertEqual(b'', pd.commonprefix('efgh'))
def test_commonprefix_full(self): pd = PrefixSet(["abcd"]) self.assertEqual("abcd", pd.commonprefix("abcd"))
def test_commonprefix_half(self): pd = PrefixSet(["abcd"]) self.assertEqual(b"ab", pd.commonprefix("abef"))
def test_commonprefix_empty(self): pd = PrefixSet(["abcd"]) self.assertEqual(b"", pd.commonprefix("efgh"))