Skip to content

Commit

Permalink
Improve XZ repair test
Browse files Browse the repository at this point in the history
  • Loading branch information
Schamper committed Jul 3, 2024
1 parent bd0f0a9 commit 81fe85e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/test_compression.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
xz,
)

import pytest


def test_lz4_decompress():
assert (
Expand Down Expand Up @@ -267,6 +269,9 @@ def test_xz_repair_checksum():
"2972e8fd62b18ee300013a8020000000deadbeefdeadbeef020000000004595a"
)
)
repaired = xz.repair_checksum(buf)

with pytest.raises(lzma.LZMAError, match="Corrupt input data"):
lzma.decompress(buf.getvalue())

repaired = xz.repair_checksum(buf)
assert lzma.decompress(repaired.read()) == b"test" * 1024

0 comments on commit 81fe85e

Please sign in to comment.