@@ -1596,7 +1596,7 @@ def test_extract_rar_with_trailing_data(self):
15961596 def test_extract_rar_broken (self ):
15971597 test_file = self .get_test_loc ('archive/rar/broken.rar' )
15981598 test_dir = self .get_temp_dir ()
1599- expected = Exception ('Unknown extraction error' )
1599+ expected = Exception ('Header CRC error' )
16001600 self .assertRaisesInstance (expected , archive .extract_rar , test_file , test_dir )
16011601
16021602 def test_extract_rar_with_relative_path (self ):
@@ -1627,21 +1627,19 @@ def test_extract_rar_with_absolute_path(self):
16271627 def test_extract_rar_with_password (self ):
16281628 test_file = self .get_test_loc ('archive/rar/rar_password.rar' )
16291629 test_dir = self .get_temp_dir ()
1630- expected = Exception ('Password protected archive, unable to extract ' )
1630+ expected = Exception ('RAR encryption support unavailable. ' )
16311631 self .assertRaisesInstance (expected , archive .extract_rar ,
16321632 test_file , test_dir )
16331633
16341634 def test_extract_rar_with_non_ascii_path (self ):
16351635 test_file = self .get_test_loc ('archive/rar/non_ascii_corrupted.rar' )
1636- # The bug only occurs if the path was given as Unicode !
1636+ # The bug only occurs if the path was given as Unicode
16371637 test_file = unicode (test_file )
16381638 test_dir = self .get_temp_dir ()
16391639 # raise an exception but still extracts some
1640- expected = Exception ('Unknown extraction error' )
1641- self .assertRaisesInstance (expected , archive .extract_rar ,
1642- test_file , test_dir )
1643- result = os .path .join (test_dir , 'EdoProject_java/WebContent'
1644- '/WEB-INF/lib/cos.jar' )
1640+ expected = Exception ('Prefix found' )
1641+ self .assertRaisesInstance (expected , archive .extract_rar , test_file , test_dir )
1642+ result = os .path .join (test_dir , 'EdoProject_java/WebContent/WEB-INF/lib/cos.jar' )
16451643 assert os .path .exists (result )
16461644
16471645
@@ -2024,21 +2022,22 @@ class TestCbr(BaseArchiveTestCase):
20242022 def test_get_extractor_cbr (self ):
20252023 test_file = self .get_test_loc ('archive/cbr/t.cbr' )
20262024 result = archive .get_extractor (test_file )
2027- expected = archive .extract_rar
2025+ # we do not handle these rare extensions (this is a RAR)
2026+ expected = None # archive.extract_rar
20282027 assert expected == result
20292028
20302029 def test_extract_cbr_basic (self ):
20312030 test_file = self .get_test_loc ('archive/cbr/t.cbr' )
20322031 test_dir = self .get_temp_dir ()
2033- archive . extract_cab (test_file , test_dir )
2032+ libarchive2 . extract (test_file , test_dir )
20342033 extracted = self .collect_extracted_path (test_dir )
20352034 expected = ['/t/' , '/t/t.txt' ]
20362035 assert expected == extracted
20372036
20382037 def test_extract_cbr_basic_with_weird_filename_extension (self ):
20392038 test_file = self .get_test_loc ('archive/cbr/t.cbr.foo' )
20402039 test_dir = self .get_temp_dir ()
2041- archive . extract_cab (test_file , test_dir )
2040+ libarchive2 . extract (test_file , test_dir )
20422041 extracted = self .collect_extracted_path (test_dir )
20432042 expected = ['/t/' , '/t/t.txt' ]
20442043 assert expected == extracted
@@ -2300,6 +2299,7 @@ def test_extract_iso_with_weird_filenames_with_sevenzip(self):
23002299 test_file = self .get_test_loc ('archive/weird_names/weird_names.iso' )
23012300 self .check_extract (sevenzip .extract , test_file , expected_warnings = [], expected_suffix = '7zip' )
23022301
2302+ @expectedFailure # not a problem: we now use libarchive for these
23032303 def test_extract_rar_with_weird_filenames_with_sevenzip (self ):
23042304 test_file = self .get_test_loc ('archive/weird_names/weird_names.rar' )
23052305 self .check_extract (sevenzip .extract , test_file , expected_warnings = [], expected_suffix = '7zip' )
0 commit comments