示例#1
0
    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"
示例#2
0
 def test_falsy_error(self, prefix, label):
     with pytest.raises(AssertionError):
         util.cut_off_prefix(prefix, label)
示例#3
0
 def test_prefix_cut_off(self):
     assert util.cut_off_prefix(b"ab", b"abc") == b"c"
示例#4
0
 def test_equals_empyt(self):
     assert util.cut_off_prefix(b"ab", b"ab") == b""
示例#5
0
 def test_no_prefix_error(self):
     with pytest.raises(AssertionError):
         util.cut_off_prefix(b"ab", "bb")