Skip to content

Commit

Permalink
Merge pull request #623 from miurahr/topic/miurahr/tests/remove-old-b…
Browse files Browse the repository at this point in the history
…inary-test-data

chore: update old test data
  • Loading branch information
miurahr authored Oct 13, 2024
2 parents 66961cb + 4870e91 commit 21226b3
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions docs/authors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ Contributors, listed alphabetically, are:
* Kyle Altendorf -- Fix multithreading problem (#82)
* Martin Larralde -- Fix writef method (#397)
* Megan Leet -- Fix infinite loop when extraction (#354)
* Michael V. Scovetta -- Help improving security concerns (#623)
* @Michał -- Fix pyannotate with removal (#588)
* Matteo Cosentino -- Help improving security concerns (#480)
* Nikolaos Episkopos -- Add recursive subdirectories extraction (#585)
* @padremayi -- Fix crash on wrong creation time in archive (#275)
* @Ravencentric -- Fix "a" mode, support Python 3.13, modernize codes, and improve CI (#604, #619)
Expand Down
Binary file modified tests/data/bcj.bin
Binary file not shown.
Binary file modified tests/data/lzma_bcj_x86.7z
Binary file not shown.
Binary file modified tests/data/x86.bin
Binary file not shown.
8 changes: 4 additions & 4 deletions tests/test_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -776,19 +776,19 @@ def test_bcj_encode(tmp_path):
odata = filter.flush()
m.update(odata)
fo.write(odata)
assert m.digest() == binascii.unhexlify("e396dadbbe0be4190cdea986e0ec949b049ded2b38df19268a78d32b90b72d42")
assert m.digest() == binascii.unhexlify("40cb9389e9eb800540389321cace40866168a2bee563e404be680c8dda3f3d4f")


@pytest.mark.unit
def test_bcj_decode(tmp_path):
def test_bcj_decode():
with open(os.path.join(testdata_path, "bcj.bin"), "rb") as f:
filter = py7zr.compressor.BCJDecoder(12800)
filter = py7zr.compressor.BCJDecoder(1052)
m = hashlib.sha256()
data = f.read(8192)
while len(data) > 0:
m.update(filter.decompress(data))
data = f.read(8192)
assert m.digest() == binascii.unhexlify("5ae0726746e2ccdad8f511ecfcf5f79df4533b83f86b1877cebc07f14a4e9b6a")
assert m.digest() == binascii.unhexlify("10c9fae2722a8dab791fd3a59393bd8ad00121db7088cd86fd8bcd36f4a12e65")


@pytest.mark.unit
Expand Down

0 comments on commit 21226b3

Please sign in to comment.