@@ -772,7 +772,7 @@ def create_and_remove_directory(directory):
772
772
def decorator (function ):
773
773
@functools .wraps (function )
774
774
def wrapper (* args , ** kwargs ):
775
- os .makedirs (directory )
775
+ os .makedirs (directory , exist_ok = True )
776
776
try :
777
777
return function (* args , ** kwargs )
778
778
finally :
@@ -789,7 +789,7 @@ def test_decompress_stdin_stdout(self):
789
789
with igzip .IGzipFile (fileobj = bytes_io , mode = 'wb' ) as igzip_file :
790
790
igzip_file .write (self .data )
791
791
792
- args = sys .executable , '-m' , 'igzip' , '-d'
792
+ args = sys .executable , '-m' , 'isal. igzip' , '-d'
793
793
with Popen (args , stdin = PIPE , stdout = PIPE , stderr = PIPE ) as proc :
794
794
out , err = proc .communicate (bytes_io .getvalue ())
795
795
@@ -803,7 +803,7 @@ def test_decompress_infile_outfile(self):
803
803
804
804
with igzip .open (igzipname , mode = 'wb' ) as fp :
805
805
fp .write (self .data )
806
- rc , out , err = assert_python_ok ('-m' , 'igzip' , '-d' , igzipname )
806
+ rc , out , err = assert_python_ok ('-m' , 'isal. igzip' , '-d' , igzipname )
807
807
808
808
with open (os .path .join (TEMPDIR , "testigzip" ), "rb" ) as gunziped :
809
809
self .assertEqual (gunziped .read (), self .data )
@@ -814,14 +814,14 @@ def test_decompress_infile_outfile(self):
814
814
self .assertEqual (err , b'' )
815
815
816
816
def test_decompress_infile_outfile_error (self ):
817
- rc , out , err = assert_python_ok ('-m' , 'igzip' , '-d' , 'thisisatest.out' )
817
+ rc , out , err = assert_python_ok ('-m' , 'isal. igzip' , '-d' , 'thisisatest.out' )
818
818
self .assertIn (b"filename doesn't end in .gz:" , out )
819
819
self .assertEqual (rc , 0 )
820
820
self .assertEqual (err , b'' )
821
821
822
822
@create_and_remove_directory (TEMPDIR )
823
823
def test_compress_stdin_outfile (self ):
824
- args = sys .executable , '-m' , 'igzip'
824
+ args = sys .executable , '-m' , 'isal. igzip'
825
825
with Popen (args , stdin = PIPE , stdout = PIPE , stderr = PIPE ) as proc :
826
826
out , err = proc .communicate (self .data )
827
827
@@ -837,7 +837,7 @@ def test_compress_infile_outfile_default(self):
837
837
with open (local_testigzip , 'wb' ) as fp :
838
838
fp .write (self .data )
839
839
840
- rc , out , err = assert_python_ok ('-m' , 'igzip' , local_testigzip )
840
+ rc , out , err = assert_python_ok ('-m' , 'isal. igzip' , local_testigzip )
841
841
842
842
self .assertTrue (os .path .exists (igzipname ))
843
843
self .assertEqual (out , b'' )
@@ -854,7 +854,7 @@ def test_compress_infile_outfile(self):
854
854
with open (local_testigzip , 'wb' ) as fp :
855
855
fp .write (self .data )
856
856
857
- rc , out , err = assert_python_ok ('-m' , 'igzip' , compress_level , local_testigzip )
857
+ rc , out , err = assert_python_ok ('-m' , 'isal. igzip' , compress_level , local_testigzip )
858
858
859
859
self .assertTrue (os .path .exists (igzipname ))
860
860
self .assertEqual (out , b'' )
@@ -863,13 +863,13 @@ def test_compress_infile_outfile(self):
863
863
self .assertFalse (os .path .exists (igzipname ))
864
864
865
865
def test_compress_fast_best_are_exclusive (self ):
866
- rc , out , err = assert_python_failure ('-m' , 'igzip' , '--fast' , '--best' )
867
- self .assertIn (b"error: argument -- best: not allowed with argument --fast" , err )
866
+ rc , out , err = assert_python_failure ('-m' , 'isal. igzip' , '--fast' , '--best' )
867
+ self .assertIn (b"error: argument -3/-- best: not allowed with argument -0/ --fast" , err )
868
868
self .assertEqual (out , b'' )
869
869
870
870
def test_decompress_cannot_have_flags_compression (self ):
871
- rc , out , err = assert_python_failure ('-m' , 'igzip' , '--fast' , '-d' )
872
- self .assertIn (b'error: argument -d/--decompress: not allowed with argument --fast' , err )
871
+ rc , out , err = assert_python_failure ('-m' , 'isal. igzip' , '--fast' , '-d' )
872
+ self .assertIn (b'error: argument -d/--decompress: not allowed with argument -0/- -fast' , err )
873
873
self .assertEqual (out , b'' )
874
874
875
875
0 commit comments