def test_other_label_is_prefix(self): assert util.common_prefix(b"abc", b"ab") == b"ab"
def test_handles_different_lengths(self): assert util.common_prefix(b"abde", b"abc") == b"ab" assert util.common_prefix(b"ab", b"ab") == b"ab" assert util.common_prefix(b"ab", b"abc") == b"ab" assert util.common_prefix(b"abde", b"abcde") == b"ab"
def test_first_char_differs_empty(self): assert util.common_prefix(b"ab", b"bb") == bytes()
def test_has_common_prefix_prefix(self): assert util.common_prefix(b"abd", b"abc") == b"ab"
def test_falsy_argument_empty(self, label, other_label): assert util.common_prefix(label, other_label) == bytes()