1919# limitations under the License.
2020#
2121
22- import io
2322import os
2423
2524import pytest
2625
27- import commoncode . date
26+ from commoncode import date as commoncode_date
2827from commoncode import fileutils
2928from commoncode .system import on_linux
3029from commoncode .system import on_mac
3130from commoncode .system import on_windows
31+ from commoncode .testcase import is_same
3232
3333from extractcode_assert_utils import BaseArchiveTestCase
3434from extractcode_assert_utils import check_files
4040from extractcode import ExtractErrorFailedToExtract
4141from extractcode import libarchive2
4242from extractcode import sevenzip
43- from extractcode .libarchive2 import ArchiveError
4443
4544"""
4645For each archive type --when possible-- we are testing extraction of:
@@ -383,7 +382,7 @@ def test_extract_targz_with_trailing_data2(self):
383382 test_dir2 = self .get_temp_dir ()
384383 test_file2 = self .get_test_loc ('archive/tgz/no_trailing.tar.gz' )
385384 archive .extract_tar (test_file2 , test_dir2 )
386- assert commoncode . testcase . is_same (test_dir1 , test_dir2 )
385+ assert is_same (test_dir1 , test_dir2 )
387386
388387 def test_extract_targz_with_mixed_case_and_symlink (self ):
389388 test_file = self .get_test_loc ('archive/tgz/mixed_case_and_symlink.tgz' )
@@ -960,7 +959,7 @@ def test_extract_zip_with_timezone(self):
960959 ]
961960 # DST sends a monkey wrench.... so we only test the date, not the time
962961 for loc , expected_date in expected :
963- result = commoncode . date .get_file_mtime (loc )
962+ result = commoncode_date .get_file_mtime (loc )
964963 assert result .startswith (expected_date )
965964
966965 def test_extract_zip_with_timezone_2 (self ):
@@ -974,7 +973,7 @@ def test_extract_zip_with_timezone_2(self):
974973 (os .path .join (test_dir , 'primes2.txt' ), ('2009-12-05' , '2009-12-06' ,))
975974 ]
976975 for loc , expected_date in expected :
977- result = commoncode . date .get_file_mtime (loc )
976+ result = commoncode_date .get_file_mtime (loc )
978977 assert result .startswith (expected_date )
979978
980979 def test_extract_zip_with_backslash_in_path_1 (self ):
@@ -1268,7 +1267,7 @@ def test_extract_ar_verify_dates(self):
12681267 ]
12691268 # DST sends a monkey wrench.... so we only test the date, not the time
12701269 for loc , expected_date in expected :
1271- result = commoncode . date .get_file_mtime (loc )
1270+ result = commoncode_date .get_file_mtime (loc )
12721271 assert result .startswith (expected_date )
12731272
12741273 def test_extract_ar_broken_7z (self ):
@@ -2318,7 +2317,7 @@ def test_extract_ar_with_weird_filenames_with_libarchive_win(self):
23182317 self .check_extract_weird_names (
23192318 libarchive2 .extract , test_file , expected_warnings = [], expected_suffix = 'libarch' )
23202319 self .fail ('Exception not raised.' )
2321- except ArchiveError as ae :
2320+ except libarchive2 . ArchiveError as ae :
23222321 assert str (ae ).startswith ('Incorrect file header signature' )
23232322
23242323 def test_extract_cpio_with_weird_filenames_with_libarchive_win (self ):
0 commit comments