Skip to content

Commit

Permalink
update a test failing with new libarchive versions (#131)
Browse files Browse the repository at this point in the history
fixes #130
  • Loading branch information
Changaco authored Sep 29, 2024
1 parent 5f7008d commit a56e940
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/test_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import pytest

from libarchive import memory_reader, memory_writer
from libarchive import ArchiveError, memory_reader, memory_writer
from libarchive.entry import ArchiveEntry, ConsumedArchiveEntry, PassedArchiveEntry

from . import data_dir, get_entries, get_tarinfos
Expand Down Expand Up @@ -64,7 +64,13 @@ def test_check_ArchiveEntry_against_TarInfo():


def test_check_archiveentry_using_python_testtar():
check_entries(join(data_dir, 'testtar.tar'))
# This test behaves differently depending on the libarchive version:
# 3.5, 3.6 and presumably all future versions reject the archive as damaged,
# whereas older versions accepted it.
try:
check_entries(join(data_dir, 'testtar.tar'))
except ArchiveError as e:
assert e.msg == "Damaged tar archive"


def test_check_archiveentry_with_unicode_and_binary_entries_tar():
Expand Down

0 comments on commit a56e940

Please sign in to comment.