1*8460358cSPatrick WilliamsFrom adb206946721a4f5bd1190ab9c975bab4373e35c Mon Sep 17 00:00:00 2001 2*8460358cSPatrick WilliamsFrom: Changaco <changaco@changaco.oy.lc> 3*8460358cSPatrick WilliamsDate: Fri, 27 Sep 2024 11:51:22 +0200 4*8460358cSPatrick WilliamsSubject: [PATCH] update a test failing with new libarchive versions 5*8460358cSPatrick Williams 6*8460358cSPatrick Williamsfixes #130 7*8460358cSPatrick Williams 8*8460358cSPatrick WilliamsUpstream-Status: Submitted [https://github.com/Changaco/python-libarchive-c/pull/131] 9*8460358cSPatrick WilliamsSigned-off-by: Ross Burton <ross.burton@arm.com> 10*8460358cSPatrick Williams--- 11*8460358cSPatrick Williams tests/test_entry.py | 10 ++++++++-- 12*8460358cSPatrick Williams 1 file changed, 8 insertions(+), 2 deletions(-) 13*8460358cSPatrick Williams 14*8460358cSPatrick Williamsdiff --git a/tests/test_entry.py b/tests/test_entry.py 15*8460358cSPatrick Williamsindex 419cecb..34543a5 100644 16*8460358cSPatrick Williams--- a/tests/test_entry.py 17*8460358cSPatrick Williams+++ b/tests/test_entry.py 18*8460358cSPatrick Williams@@ -9,7 +9,7 @@ 19*8460358cSPatrick Williams 20*8460358cSPatrick Williams import pytest 21*8460358cSPatrick Williams 22*8460358cSPatrick Williams-from libarchive import memory_reader, memory_writer 23*8460358cSPatrick Williams+from libarchive import ArchiveError, memory_reader, memory_writer 24*8460358cSPatrick Williams from libarchive.entry import ArchiveEntry, ConsumedArchiveEntry, PassedArchiveEntry 25*8460358cSPatrick Williams 26*8460358cSPatrick Williams from . import data_dir, get_entries, get_tarinfos 27*8460358cSPatrick Williams@@ -64,7 +64,13 @@ def test_check_ArchiveEntry_against_TarInfo(): 28*8460358cSPatrick Williams 29*8460358cSPatrick Williams 30*8460358cSPatrick Williams def test_check_archiveentry_using_python_testtar(): 31*8460358cSPatrick Williams- check_entries(join(data_dir, 'testtar.tar')) 32*8460358cSPatrick Williams+ # This test behaves differently depending on the libarchive version: 33*8460358cSPatrick Williams+ # 3.5, 3.6 and presumably all future versions reject the archive as damaged, 34*8460358cSPatrick Williams+ # whereas older versions accepted it. 35*8460358cSPatrick Williams+ try: 36*8460358cSPatrick Williams+ check_entries(join(data_dir, 'testtar.tar')) 37*8460358cSPatrick Williams+ except ArchiveError as e: 38*8460358cSPatrick Williams+ assert e.msg == "Damaged tar archive" 39*8460358cSPatrick Williams 40*8460358cSPatrick Williams 41*8460358cSPatrick Williams def test_check_archiveentry_with_unicode_and_binary_entries_tar(): 42