File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99
1010import pytest
1111
12- from libarchive import memory_reader , memory_writer
12+ from libarchive import ArchiveError , memory_reader , memory_writer
1313from libarchive .entry import ArchiveEntry , ConsumedArchiveEntry , PassedArchiveEntry
1414
1515from . import data_dir , get_entries , get_tarinfos
@@ -64,7 +64,13 @@ def test_check_ArchiveEntry_against_TarInfo():
6464
6565
6666def test_check_archiveentry_using_python_testtar ():
67- check_entries (join (data_dir , 'testtar.tar' ))
67+ # This test behaves differently depending on the libarchive version:
68+ # 3.5, 3.6 and presumably all future versions reject the archive as damaged,
69+ # whereas older versions accepted it.
70+ try :
71+ check_entries (join (data_dir , 'testtar.tar' ))
72+ except ArchiveError as e :
73+ assert e .msg == "Damaged tar archive"
6874
6975
7076def test_check_archiveentry_with_unicode_and_binary_entries_tar ():
You can’t perform that action at this time.
0 commit comments