mirror of https://github.com/borgbackup/borg.git
zlib legacy decompress: fix tests
This commit is contained in:
parent
0ac525bb05
commit
f0e9999768
|
@ -50,7 +50,7 @@ def test_lz4_buffer_allocation(monkeypatch):
|
||||||
@pytest.mark.parametrize("invalid_cdata", [b"\xff\xfftotalcrap", b"\x08\x00notreallyzlib"])
|
@pytest.mark.parametrize("invalid_cdata", [b"\xff\xfftotalcrap", b"\x08\x00notreallyzlib"])
|
||||||
def test_autodetect_invalid(invalid_cdata):
|
def test_autodetect_invalid(invalid_cdata):
|
||||||
with pytest.raises(ValueError):
|
with pytest.raises(ValueError):
|
||||||
Compressor(**params, legacy_mode=True).decompress({}, invalid_cdata)
|
Compressor(**params, legacy_mode=True).decompress(None, invalid_cdata)
|
||||||
|
|
||||||
|
|
||||||
def test_zlib_legacy_compat():
|
def test_zlib_legacy_compat():
|
||||||
|
@ -61,7 +61,7 @@ def test_zlib_legacy_compat():
|
||||||
meta1, cdata1 = c.compress({}, DATA)
|
meta1, cdata1 = c.compress({}, DATA)
|
||||||
cdata2 = zlib.compress(DATA, level)
|
cdata2 = zlib.compress(DATA, level)
|
||||||
assert cdata1 == cdata2
|
assert cdata1 == cdata2
|
||||||
meta2, data2 = c.decompress({}, cdata2)
|
meta2, data2 = c.decompress(None, cdata2)
|
||||||
assert DATA == data2
|
assert DATA == data2
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue