@@ -772,7 +772,7 @@ def create_and_remove_directory(directory):
772772 def decorator (function ):
773773 @functools .wraps (function )
774774 def wrapper (* args , ** kwargs ):
775- os .makedirs (directory )
775+ os .makedirs (directory , exist_ok = True )
776776 try :
777777 return function (* args , ** kwargs )
778778 finally :
@@ -789,7 +789,7 @@ def test_decompress_stdin_stdout(self):
789789 with igzip .IGzipFile (fileobj = bytes_io , mode = 'wb' ) as igzip_file :
790790 igzip_file .write (self .data )
791791
792- args = sys .executable , '-m' , 'igzip' , '-d'
792+ args = sys .executable , '-m' , 'isal. igzip' , '-d'
793793 with Popen (args , stdin = PIPE , stdout = PIPE , stderr = PIPE ) as proc :
794794 out , err = proc .communicate (bytes_io .getvalue ())
795795
@@ -803,7 +803,7 @@ def test_decompress_infile_outfile(self):
803803
804804 with igzip .open (igzipname , mode = 'wb' ) as fp :
805805 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 )
807807
808808 with open (os .path .join (TEMPDIR , "testigzip" ), "rb" ) as gunziped :
809809 self .assertEqual (gunziped .read (), self .data )
@@ -814,14 +814,14 @@ def test_decompress_infile_outfile(self):
814814 self .assertEqual (err , b'' )
815815
816816 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' )
818818 self .assertIn (b"filename doesn't end in .gz:" , out )
819819 self .assertEqual (rc , 0 )
820820 self .assertEqual (err , b'' )
821821
822822 @create_and_remove_directory (TEMPDIR )
823823 def test_compress_stdin_outfile (self ):
824- args = sys .executable , '-m' , 'igzip'
824+ args = sys .executable , '-m' , 'isal. igzip'
825825 with Popen (args , stdin = PIPE , stdout = PIPE , stderr = PIPE ) as proc :
826826 out , err = proc .communicate (self .data )
827827
@@ -837,7 +837,7 @@ def test_compress_infile_outfile_default(self):
837837 with open (local_testigzip , 'wb' ) as fp :
838838 fp .write (self .data )
839839
840- rc , out , err = assert_python_ok ('-m' , 'igzip' , local_testigzip )
840+ rc , out , err = assert_python_ok ('-m' , 'isal. igzip' , local_testigzip )
841841
842842 self .assertTrue (os .path .exists (igzipname ))
843843 self .assertEqual (out , b'' )
@@ -854,7 +854,7 @@ def test_compress_infile_outfile(self):
854854 with open (local_testigzip , 'wb' ) as fp :
855855 fp .write (self .data )
856856
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 )
858858
859859 self .assertTrue (os .path .exists (igzipname ))
860860 self .assertEqual (out , b'' )
@@ -863,13 +863,13 @@ def test_compress_infile_outfile(self):
863863 self .assertFalse (os .path .exists (igzipname ))
864864
865865 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 )
868868 self .assertEqual (out , b'' )
869869
870870 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 )
873873 self .assertEqual (out , b'' )
874874
875875
0 commit comments