def test_does_not_modify(self): p = b"ab" l = b"abc" assert util.cut_off_prefix(p, l) == b"c" assert l == b"abc" assert p == b"ab"
def test_falsy_error(self, prefix, label): with pytest.raises(AssertionError): util.cut_off_prefix(prefix, label)
def test_prefix_cut_off(self): assert util.cut_off_prefix(b"ab", b"abc") == b"c"
def test_equals_empyt(self): assert util.cut_off_prefix(b"ab", b"ab") == b""
def test_no_prefix_error(self): with pytest.raises(AssertionError): util.cut_off_prefix(b"ab", "bb")