
    z%i                        	 d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlm	Z	m
Z
 d dlmZ d dlmZ d dlmZmZmZ d dlmZmZ  ej(                  d      Z ej(                  d      Zd	Zd
Zej2                  j5                  ej6                        dz   Z G d dej:                        Z G d dej>                        Z  G d de       Z! G d de       Z"d Z# G d dej>                        Z$e%dk(  r ejL                          yy)    N)PIPEPopen)import_helper)	os_helper)_4G
bigmemtestrequires_subprocess)assert_python_okassert_python_failuregzipzlibsy     int length=DEFAULTALLOC, err = Z_OK;
  PyObject *RetVal;
  int flushmode = Z_FINISH;
  unsigned long start_total_out;

s   /* zlibmodule.c -- gzip-compatible data compression */
/* See http://www.gzip.org/zlib/
/* See http://www.winimage.com/zLibDll for Windows */
z-gzdirc                       e Zd Zd Zd Zd Zy)UnseekableIOc                      y)NF selfs    B/home/uftp/.pyenv/versions/3.12.0/lib/python3.12/test/test_gzip.pyseekablezUnseekableIO.seekable&   s        c                 "    t         j                  NioUnsupportedOperationr   s    r   tellzUnseekableIO.tell)       %%%r   c                 "    t         j                  r   r   )r   argss     r   seekzUnseekableIO.seek,   r   r   N)__name__
__module____qualname__r   r   r    r   r   r   r   r   %   s    &&r   r   c                   0    e Zd Zej                  Zd Zd Zy)BaseTestc                 B    t        j                  | j                         y r   r   unlinkfilenamer   s    r   setUpzBaseTest.setUp3       'r   c                 B    t        j                  | j                         y r   r'   r   s    r   tearDownzBaseTest.tearDown6   r+   r   N)r!   r"   r#   r   TESTFNr)   r*   r-   r   r   r   r%   r%   0   s    H((r   r%   c                   Z   e Zd Zd7dZd Zd Zd Zd Zd Zd Z	d Z
d	 Z eed
      d        Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z d Z!d  Z"d! Z#d" Z$d# Z%d$ Z&d% Z'd& Z(d' Z)d( Z*d) Z+d* Z,d+ Z-d, Z.d- Z/d. Z0d/ Z1d0 Z2d1 Z3d2 Z4d3 Z5d4 Z6d5 Z7y6)8TestGzipc                    t        |      }t        j                  | j                  d|z         5 }|j	                  |      }d d d        | j                  t        |             t        j                  | j                  d|z         5 }| j                  |j                         |       d d d        y # 1 sw Y   qxY w# 1 sw Y   y xY w)Nwr)bytesr   GzipFiler)   writeassertEquallenread)r   datamodeb_datafls         r   write_and_read_backzTestGzip.write_and_read_back;   s    t]]4==#d(3 	qA	CK(]]4==#d(3 	/qQVVXv.	/ 	/	 		/ 	/s   B1!B=1B:=Cc                    t         j                  | j                  d      5 }|j                  t        dz         |j                          |j                          t        t        d      r#t        j                  |j                                |j                          d d d        j                          y # 1 sw Y   xY w)Nwb2   fsync)r   r5   r)   r6   data1flushfilenohasattrosrC   closer   r=   s     r   
test_writezTestGzip.test_writeC   s    ]]4==$/ 	1GGEBJ GGIHHJr7#$GGI	 	
		 	s   A<B66B?c                 n   t        j                  | j                        }t        j	                  |d      5 }|j                  t        dz         d d d        | j                  j                  t               t        j	                  |d      5 }|j                  t               d d d        t        j	                  |      5 }|j                         }d d d        | j                  t        dz         | j                  |j                  t               y # 1 sw Y   xY w# 1 sw Y   }xY w# 1 sw Y   [xY w)Nr2   rB   a3   )pathlibPathr)   r   r5   r6   rD   assertIsInstancenamestrr9   r7   )r   r)   r=   ds       r   "test_write_read_with_pathlike_filez+TestGzip.test_write_read_with_pathlike_fileQ   s    <<.]]8S) 	 QGGEBJ	 affc*]]8S) 	QGGEN	]]8$ 	A	EBJ'affc*	  	 	 		 	s#   DD D+DD(+D4c                     | j                  t        t        dz               t        t        t	        d                  }|j                  dg d      }| j                  |       y )NrB      B)   rY      )shape)r?   
memoryviewrD   r4   rangecast)r   mr:   s      r   test_write_memoryviewzTestGzip.test_write_memoryview`   sL      EBJ!78uU3Z()vvcv)  &r   c                 F    | j                  t        t        dz               y )NrB   )r?   	bytearrayrD   r   s    r   test_write_bytearrayzTestGzip.test_write_bytearrayf   s      52:!67r   c                 \    | j                  t        j                  dt        dz               y )NI(   )r?   arrayrD   r   s    r   test_write_arrayzTestGzip.test_write_arrayi   s      S%"*!=>r   c                 6   t         j                  | j                  d      5 }| j                  t              5  |j                  d       d d d        | j                  t              5  |j                  g        d d d        |j                  t               d d d        t         j                  | j                  d      5 }| j                  |j                         t               d d d        y # 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   oxY w# 1 sw Y   y xY w)NrA    rb)	r   r5   r)   assertRaises	TypeErrorr6   rD   r7   r9   rJ   s     r   test_write_incompatible_typez%TestGzip.test_write_incompatible_typel   s     ]]4==$/ 	1""9- ""9- GGEN	 ]]4==$/ 	.1QVVXu-	. 	.  	 		. 	.sF   DC+	D&C78D=%D+C4	0D7D 	<DDDc                     | j                          t        j                  | j                  d      5 }|j	                         }d d d        | j                  t        dz         y # 1 sw Y   #xY w)Nr3   rB   )rK   r   r5   r)   r9   r7   rD   r   r=   rT   s      r   	test_readzTestGzip.test_ready   sT    ]]4==#. 	!A	E"H%	 	s   A$$A-c                    | j                          g }d}t        j                  | j                  d      5 }	 |j	                         }|sn@|j                  |       |t        |      z  }| j                  |j                         |       S	 d d d        | j                  dj                  |      t        dz         y # 1 sw Y   2xY w)Nr   r3   r   rB   )rK   r   r5   r)   read1appendr8   r7   r   joinrD   )r   blocksnreadr=   rT   s        r   
test_read1zTestGzip.test_read1   s    ]]4==#. 	2!GGIa Q  51  		2 	&)52:6	2 	2s   AB<<C   )sizememusec                     t         j                  t        d      }t         j                  t	        j
                  |      d      }| j                  |j                  |      t               y )Nry   compresslevelrk   fileobjr;   )r   compressrD   r5   r   BytesIOr7   r9   )r   rz   
compressedr=   s       r   test_read_largezTestGzip.test_read_large   sI     ]]5]:
MM"**Z"8tMDu-r   c                 :   | j                          t        j                  | j                  d      }|j                  }| j                  |j                         |j                          | j                  |j                         | j                  t              5  |j                  d       d d d        | j                  t              5  |j                  d       d d d        | j                  t              5  |j                          d d d        t        j                  | j                  d      }|j                  }| j                  |j                         |j                          | j                  |j                         | j                  t              5  |j                  d       d d d        | j                  t              5  |j                          d d d        y # 1 sw Y   7xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   ^xY w# 1 sw Y   y xY w)Nr3   ry   r   r2   r   )rK   r   r5   r)   r   assertFalseclosedrI   
assertTruerl   
ValueErrorr9   r    r   r6   rE   )r   r=   r   s      r   test_io_on_closed_objectz!TestGzip.test_io_on_closed_object   s   
 	MM$---))(		'z* 	FF1I	z* 	FF1I	z* 	FFH	 MM$---))(		'z* 	GGCL	z* 	GGI	 		 		 		 		 		 	s<   GG,6G9HHG),G69HHHc                    | j                          t        j                  | j                  d      5 }|j	                  t
        dz         d d d        t        j                  | j                  d      5 }|j                         }d d d        | j                  t        dz  t
        dz  z          y # 1 sw Y   fxY w# 1 sw Y   9xY w)Nab   rk   rB   )	rK   r   r5   r)   r6   data2r9   r7   rD   rp   s      r   test_appendzTestGzip.test_append   s    ]]4==$/ 	 1GGEBJ	  ]]4==$/ 	1A	U2X%(34	  	 	 	s   B/2B;/B8;Cc                    t         j                  | j                  dd      5 }|j                  d       d d d        t	        dd      D ]=  }t         j                  | j                  dd      5 }|j                  d       d d d        ? t         j                  | j                  d      5 }d}	 |j                  d	      }||z  }|sn	 d d d        | j                  d
       y # 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   4xY w)NrA   	      ar      r   rk   r   i    s   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)r   r5   r)   r6   r]   r9   r7   )r   r=   izgfilecontentsztxts         r   test_many_appendzTestGzip.test_many_append   s     ]]4==$2 	aGGDM	q# 	At}}dA6 ! 	
 ]]4==$/ 	#6H{{4(D U  #	# 	8,	 	 	# 	#s#   C",C.(C:"C+.C7	:Dc                    t         j                  | j                  d      5 }|j                  t        dz         d d d        t         j                  | j                  d      5 }| j                  |j                         t        dz         d d d        | j                  t              5  t         j                  | j                  d       d d d        y # 1 sw Y   xY w# 1 sw Y   TxY w# 1 sw Y   y xY w)NxbrB   rk   )	r   r5   r)   r6   rD   r7   r9   rl   FileExistsErrorrJ   s     r   test_exclusive_writezTestGzip.test_exclusive_write   s    ]]4==$/ 	 1GGEBJ	 ]]4==$/ 	31QVVXurz2	3/ 	/MM$--.	/ 	/		  	 	3 	3	/ 	/s#   C"(C'!C)CC&)C2c                 \   | j                          t        j                  | j                  d      5 }t	        j
                  |      5 }|D cg c]  }| }}d d d        d d d        | j                  dt        j                  d      z         y c c}w # 1 sw Y   @xY w# 1 sw Y   DxY w)Nrk   rB   Tkeepends)	rK   r   r5   r)   r   BufferedReaderr7   rD   
splitlines)r   r=   r3   lineliness        r   test_buffered_readerzTestGzip.test_buffered_reader   s     	]]4==$/ 	-1""1% -*+,$,,-	- 	U%5%5t%5%D DE -- -	- 	-s5   B"B	BBB"BB	B""B+c                    | j                          t        j                  | j                  d      5 }d}	 |j	                  |      }|s|dk7  rn&| j                  t        |      |k         |dz   dz  }?	 d d d        y # 1 sw Y   y xY w)Nrk   r   ry   rB   )rK   r   r5   r)   readliner   r8   )r   r=   line_lengthLs       r   test_readlinezTestGzip.test_readline   s     ]]4==$/ 	51KJJ{+[A-uA+ 56*Q"4	 /4		5 	5 	5s   AA>>Bc                 L   | j                          t        j                  | j                  d      5 }|j	                         }d d d        t        j                  | j                  d      5 }	 |j	                  d      }|g k(  rn	 d d d        y # 1 sw Y   MxY w# 1 sw Y   y xY w)Nrk      )rK   r   r5   r)   	readlines)r   r=   r   s      r   test_readlineszTestGzip.test_readlines   s     ]]4==$/ 	1A	 ]]4==$/ 	"1KK$7E !	" 	"	 		" 	"s   B*BBB#c                    | j                          t        j                  | j                        5 }	 |j	                         }|j                         }|snu|j	                         }|j                  |       t        |      dkD  rd}nt        |      }|j                  |      }| j                  |d | |       |j                  |       	 d d d        y # 1 sw Y   y xY w)N
   )
rK   r   r5   r)   r   r   r    r8   r9   r7   )r   r=   oldposline1newposamountline2s          r   test_seek_readzTestGzip.test_seek_read   s     ]]4==) 	Q

evu:b=F ZFv  w7v  $		 	 	s   BCCc                 (   | j                          t        j                  | j                        5 }|j	                  d       |j                  dd       |j	                  d      }d d d        | j                  t        dd        y # 1 sw Y   #xY w)Nr   ry   )whence      )rK   r   r5   r)   r9   r    r7   rD   )r   r=   ys      r   test_seek_whencezTestGzip.test_seek_whence  su     ]]4==) 	QFF2JFF2aF r
A	 	E"RL)		 	s   6BBc                     t         j                  | j                  d      5 }t        ddd      D ]$  }|j	                  |       |j                  d       & 	 d d d        y # 1 sw Y   y xY w)Nr2   r   rW      s   GZ
)r   r5   r)   r]   r    r6   )r   r=   poss      r   test_seek_writezTestGzip.test_seek_write  sZ    ]]4==#. 	!!QR( !s !	! 	! 	!s   5A  A)c                    | j                          t        j                  | j                  d      5 }| j	                  |j
                  j                  d       d d d        t        j                  | j                         t        j                  | j                  d      5 }| j	                  |j
                  j                  d       d d d        y # 1 sw Y   xxY w# 1 sw Y   y xY w)Nr3   rk   xr   )	rK   r   r5   r)   r7   	myfileobjr;   r   r(   rJ   s     r   	test_modezTestGzip.test_mode  s    ]]4==#. 	5!Q[[--t4	5']]4==#. 	5!Q[[--t4	5 	5	5 	5	5 	5s   'C'CCC$c                     dD ]l  }t         j                  | j                  |      5 }| j                  t	        |d             | j                  |j                  | j                         d d d        n y # 1 sw Y   yxY w)N)rA   rk   rR   )r   r5   r)   r   rG   r7   rR   )r   r;   r=   s      r   test_1647484zTestGzip.test_1647484'  sj      	8Dt}}d3 8q6 23  78 8	88 8s   AA33A<	c                 8   | j                          t        j                  | j                  d      5 }| j	                  t        |j                  d             | j                  |j                  j                  | j                         d d d        y # 1 sw Y   y xY w)Nrk   rR   )	rK   r   r5   r)   r   rG   r   r7   rR   rJ   s     r   test_paddedfile_getattrz TestGzip.test_paddedfile_getattr-  sh    ]]4==$/ 	<1OOGAIIv67QYY^^T]];	< 	< 	<s   ABBc                    d}t         j                  | j                  d|      5 }|j                  t               d d d        t         j                  | j                        5 }| j                  t        |d             | j                  |j                         |j                         }| j                  |t               | j                  |j                  |       d d d        y # 1 sw Y   xY w# 1 sw Y   y xY w)N[r2   mtimer   )r   r5   r)   r6   rD   r   rG   assertIsNoner   r9   r7   )r   r   fWritefReaddataReads        r   
test_mtimezTestGzip.test_mtime3  s    ]]4==#u]= 	 LL	 ]]4==) 	1UOOGE734ekk*zz|HXu-U[[%0	1 	1	  	 	1 	1s   C$"A9C0$C-0C9c           
         d}t         j                  | j                  d|      5 }|j                  t               d d d        t        | j                  d      5 }|j                  d      }| j                  |d       |j                  d      }| j                  |d       	 | j                  j                  d	      d
z   }d}|j                  d      }| j                  ||       |j                  d      }	| j                  |	t        j                  d|             |j                  d      }
| j                  |
d       |j                  d      }| j                  |d       |j                  t        |            }| j                  ||       |j                  t        j                  | j                        j                   dz
         |j                  d      }| j                  |d       |j                  d      }| j                  |t        j                  dt        t                           d d d        y # 1 sw Y   xY w# t        $ r d}d
}Y w xY w# 1 sw Y   y xY w)Nr   r2   r   rk         ry      zLatin-1    r   rZ   z<i      rY   s   d)r   r5   r)   r6   rD   openr9   r7   encodeUnicodeEncodeErrorstructpackr8   r    rH   statst_size)r   r   r   r   idBytescmByteexpectednameexpectedflags	flagsByte
mtimeBytesxflByteosByte	nameBytes
crc32Bytes
isizeBytess                  r   test_metadatazTestGzip.test_metadata>  s   ]]4==#u]= 	 LL	  $--& +	H% jjmGWk2ZZ]FVW-(#}}33I>H '
 

1IY6AJZT5)ABjjmGWg.ZZ]FVW- 

3|#45IY5 JJrwwt}}-559:AJZ)9:AJZT3u:)FGW+	H +	H	  	  & (" '(+	H +	Hs=   H8AI! IE.I8IIIIII"c                 N    t         j                  | _        | j                          y r   )r   TESTFN_ASCIIr)   r   r   s    r   test_metadata_ascii_namez!TestGzip.test_metadata_ascii_nameq  s    !..r   c                    g d}d}|D ]  \  }}}| j                  |      5  t        j                  | j                  d|      }|5  |j	                  t
               d d d        t        | j                  d      5 }|j                  |       |j                  d      }| j                  ||       d d d        d d d         y # 1 sw Y   gxY w# 1 sw Y    xY w# 1 sw Y   xY w)N))fastry      )bestr   r   )tradeoff   r   rY   r2   r}   rk   ry   )
subTestr   r5   r)   r6   rD   r   r    r9   r7   )	r   cases	xflOffsetrR   levelexpectedXflByter   r   r   s	            r   test_compresslevel_metadataz$TestGzip.test_compresslevel_metadatau  s    

 	.3 	?*T5/d# ?t}}cO (LL'($--. ?%JJy)#jjmG$$Wo>?	? ?	?( (? ?	? ?s;   %CCC:5C/CCCCCC#	c                    t         j                  | j                  d      5 }|j                  d       d d d        t         j                  | j                  d      }|j	                          	 |5  	 d d d        | j                  d       	 t         j                  | j                  d      5 }ddz   d d d        | j                  d       y # 1 sw Y   xY w# 1 sw Y   gxY w# t        $ r Y dw xY w# 1 sw Y   BxY w# t        $ r Y y w xY w)NrA   s   xxxrk   z4__enter__ on a closed file didn't raise an exceptionry   r   z1/0 didn't raise an exception)r   r5   r)   r6   rI   failr   ZeroDivisionErrorrJ   s     r   test_with_openzTestGzip.test_with_open  s    ]]4==$/ 	1GGFO	MM$--.			N 
 IILM	7t}}d3 q!
 II56#	 	
  		
   		s_   C
,C" .C0C" 
 C= *C10C= 
CCC" "	C.-C.1C:6C= =	D	D	c                    t         j                  | j                  d      5 }|j                  t        dz         d d d        t        | j                  d      5 }|j                  d       d d d        t         j                  | j                  d      5 }|j                         }| j                  |t        dz  d       d d d        y # 1 sw Y   xY w# 1 sw Y   ixY w# 1 sw Y   y xY w)NrA   rB   r   s2                                                     rk   zIncorrect data in file)r   r5   r)   r6   rD   r   r9   r7   rp   s      r   test_zero_padded_filezTestGzip.test_zero_padded_file  s    ]]4==$/ 	 1GGEBJ	  $--& 	"!GGL!	" ]]4==$/ 	F1AQ
,DE	F 	F	  	 	" 	"	F 	Fs#   CC+CCCC'c                 ^    | j                  t        t        j                  t                     y r   )r   
issubclassr   BadGzipFileOSErrorr   s    r   test_gzip_BadGzipFile_exceptionz(TestGzip.test_gzip_BadGzipFile_exception  s    
4#3#3W=>r   c                 H   t        | j                  d      5 }|j                  t        dz         d d d        t        j                  | j                  d      5 }| j                  t        j                  |j                         d d d        y # 1 sw Y   ]xY w# 1 sw Y   y xY w)NrA   rB   r3   )	r   r)   r6   rD   r   r5   rl   r  r   )r   files     r   test_bad_gzip_filezTestGzip.test_bad_gzip_file  s    $--& 	#$JJurz"	#]]4==#. 	@$d..?	@ 	@	# 	#	@ 	@s   B+BBB!c                 r   t         dz  }t               }t        j                  |d      5 }|j	                  |       d d d        |j                         }t        |      }t        j                  |d      5 }| j                  |j                         |       d d d        y # 1 sw Y   exY w# 1 sw Y   y xY w)NrB   rA   r   rk   )rD   r   r   r5   r6   getvaluer7   r9   )r   uncompressedbufr=   r   s        r   test_non_seekable_filezTestGzip.test_non_seekable_file  s    rzn]]3T]2 	"aGGL!	"\\^
:&]]3T]2 	5aQVVX|4	5 	5		" 	"	5 	5s   B!7!B-!B*-B6c           	      T   t         dz  }t        j                  | j                  d      5 }|j	                  |       d d d        d }t        j                  | j                  d      5 }d|_        d} |       D ]R  }|j                  |      }|dk(  r n:| j                  |j                  t        |            |       |t        |      z  }T | j                  |j                  d      d       | j                  |t        |             d d d        y # 1 sw Y   xY w# 1 sw Y   y xY w)	Nr   rA   c               3   :   K   	 t        ddd      D ]  } |   w)N   rB   r   )r]   )ns    r   sizesz!TestGzip.test_peek.<locals>.sizes  s+     q"b) AG s   rk   !   r   r   d   )
rD   r   r5   r)   r6   max_read_chunkpeekr7   r9   r8   )r   r
  r=   r  rw   r  ss          r   	test_peekzTestGzip.test_peek  s   s{]]4==$/ 	"1GGL!	"	
 ]]4==$/ 
	71!AEW  FF1I8  A3Q  QVVC[#.UC$56
	7 
	7	" 	"
	7 
	7s   D'B"DDD'c                 v   t         dz  j                  d      j                  d      }| j                          t        j                  | j                  d      5 }t        j                  |d      5 }| j                  |j                         |       d d d        d d d        y # 1 sw Y   xY w# 1 sw Y   y xY w)NrB   asciiTr   r3   encoding)rD   decoder   rK   r   r5   r)   r   TextIOWrapperr7   r   )r   r   r=   ts       r   test_textio_readlineszTestGzip.test_textio_readlines  s    ##G,777F]]4==#. 	7!!!!g6 7!  67	7 	77 7	7 	7s$   B/1!B#B/#B,	(B//B8c                 2   t        j                  | j                  t         j                  t         j                  z        }t        j
                  |d      5 }t        j                  |d      5 }	 d d d        d d d        y # 1 sw Y   xY w# 1 sw Y   y xY w)NrA   r2   r   )rH   r   r)   O_WRONLYO_CREATfdopenr   r5   )r   fdr=   gs       r   test_fileobj_from_fdopenz!TestGzip.test_fileobj_from_fdopen  sy     WWT]]BKK"**$<=YYr4  	Aqs3 q	 	 	 	s$   B.B0BB
	BBc                    t         j                  | j                  d      j                          t	        | j                  d      5 }t         j                  |d      5 }| j                  |j                  t         j                         d d d        t         j                  |d      5 }| j                  |j                  t         j                         d d d        t         j                  |d      5 }| j                  |j                  t         j                         d d d        t         j                  |d      5 }| j                  |j                  t         j                         d d d        | j                  t              5  t         j                  |d       d d d        d d d        d	D ]j  }t	        | j                  |      5 }t         j                  |
      5 }| j                  |j                  t         j                         d d d        d d d        l dD ]  }d|v rt        j                  | j                         t	        | j                  |      5 }| j                  t              5  t         j                  |
      }d d d        5  | j                  |j                  t         j                         d d d        d d d         y # 1 sw Y   GxY w# 1 sw Y   
xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   hxY w# 1 sw Y   mxY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   ;xY w)NrA   r+br3   r   r2   rM   r   z)rk   r(  r   )rA   r   r   )r   r5   r)   rI   r   r7   r;   READWRITErl   r   r   r(   assertWarnsFutureWarning)r   r=   r%  r;   s       r   test_fileobj_modezTestGzip.test_fileobj_mode  s   dmmT*002$--' 
	31qs3 4q  34qs3 5q  45qs3 5q  45qs3 5q  45"":. 3ac23
	3   	8DdmmT* 8a]]1]- 8$$QVVTYY788 8	8 % 	9Dd{  /dmmT* 9a%%m4 1a0A1 9$$QVVTZZ899 9	94 45 55 55 53 3
	3 
	38 88 81 19 99 9s   L+KL'+KL1+K'L;+K4&LLLL(+LL(M.L5
M+M:MK	LK$	L'K1	,L4K>	9LL	LLL% L((L2	5L>:MM
MM	c                 N   | j                   }	 |j                  d      }t        j                  d      5 }|j                  t        dz         d d d        t        j                  |d      5 }| j                  |j                         t        dz         d d d        t        j                  |d      5 }| j                  |j                         t        dz         d d d        y # t        $ r | j                  d       Y w xY w# 1 sw Y   xY w# 1 sw Y   |xY w# 1 sw Y   y xY w)Nr  z%Temporary file name needs to be ASCIIrA   rB   rk   )
r)   r   r   skipTestr   r5   r6   rD   r7   r9   )r   str_filenamebytes_filenamer=   s       r   test_bytes_filenamezTestGzip.test_bytes_filename  s    }}	C)009N ]]>40 	 AGGEBJ	 ]]>40 	3AQVVXurz2	3 ]]<. 	3!QVVXurz2	3 	3 " 	CMMAB	C	  	 	3 	3	3 	3s4   C# D,(D2(D#D ?D DDD$c                    	 t         j                  dt        d      z  d      }| j                  t	        |      t
        j                         t        j                  |      }t         j                  |      }| j                  |j                  d      d       dt
        j                  z   }| j                  |j                  j                  j                         |d       y )Nr   g    >Ar   r}   r*  ry   z)Excessive amount of data was decompressed)r   r   int
assertLessr8   r   DEFAULT_BUFFER_SIZEr   r5   r7   r9   assertLessEqual_bufferrawr   )r   bombdecomp
max_decomps       r   test_decompress_limitedz TestGzip.test_decompress_limited  s    ;}}USX-Q}?D	2#9#9:zz$t,Q////
V^^//446
7	9r   c                 \   t         t        fD ]  }dD ]  }t        j                  |g| }| j	                  t        |      t               t        j                  t        j                  |      d      5 }| j	                  |j                         |       d d d          y # 1 sw Y   xY w)Nr   )ry   )r   )r   rk   r   )rD   r   r   r   r7   typer4   r5   r   r   r9   )r   r:   r   datacr=   s        r   test_compresszTestGzip.test_compress  s    EN 	5D. 5d2T2  ee4]]2::e+<4]H 5A$$QVVXt45 55	55 5s   4!B""B+c           	         d}t         t        fD ]  }dD ]  }| j                  ||      5  t        j                  |g|d|i}| j                  t        |      t               t        j                  t        j                  |      d      5 }|j                  d       | j                  |j                  |       d d d        d d d          y # 1 sw Y   xY w# 1 sw Y   xY w)Nr   rA  )r:   r   r   rk   r   ry   )rD   r   r   r   r   r7   rB  r4   r5   r   r   r9   r   )r   r   r:   r   rC  r=   s         r   test_compress_mtimezTestGzip.test_compress_mtime!  s    EN 	9D. 9\\t$\7 9 MM$CCUCE$$T%[%8rzz%/@tL 9PQq	((%899 99	9
9 99 9s$   A#C.C	;CCCC%c                 (   dD ]  }| j                  |      5  t        j                  t        d|      }t        j                  t        d|      }| j	                  t        |       | j                  t        |       d d d         y # 1 sw Y   xY w)N)r   *   r   r   )r~   r   ry   )r   r   r   rD   assertInassertNotIn)r   r   
nocompressyescompresss       r   test_compress_correct_levelz$TestGzip.test_compress_correct_level,  s     	5EE* 5!]]5]O
"mmE%mPeZ0  4	5 5	55 5s   A%BB	c                    t         t        fD ]  }t        j                         }t        j                  |d      5 }|j                  |       d d d        | j                  t        j                  |j                               |       t        j                  |      }| j                  t        j                  |      |        y # 1 sw Y   yxY w)NrA   r   )rD   r   r   r   r   r5   r6   r7   
decompressr	  r   )r   r:   r  r=   rC  s        r   test_decompresszTestGzip.test_decompress5  s    EN 	;D**,Cs6 !T__S\\^<dCMM$'ET__U3T:	; s   CC	c                     t         j                  t              }| j                  t        t         j
                  |d d        y )Nr   r   rD   rl   EOFErrorrO  r   compressed_datas     r   !test_decompress_truncated_trailerz*TestGzip.test_decompress_truncated_trailer?  -    --.(DOO_Sb5IJr   c                     t         j                  t              }| j                  t        t         j
                  |d d        y )NrS  rU  s     r   test_decompress_missing_trailerz(TestGzip.test_decompress_missing_trailerC  rX  r   c                    t         dz  }t        j                  |      d d }t        j                  t	        j
                  |            5 }| j                  t        |j                         d d d        t        j                  t	        j
                  |            5 }| j                  |j                  t        |            |       | j                  t        |j                  d       d d d        t        dd      D ]X  }t        j                  t	        j
                  |d |             5 }| j                  t        |j                  d       d d d        Z y # 1 sw Y   xY w# 1 sw Y   }xY w# 1 sw Y   }xY w)NrB   rZ  r*  ry   r   r   )rD   r   r   r5   r   r   rl   rT  r9   r7   r8   r]   )r   r:   	truncatedr=   r   s        r   test_read_truncatedzTestGzip.test_read_truncatedG  s)   RxMM$',	]]2::i#8]9 	0Qh/	0]]2::i#8]9 	3QQVVCI.5h2	3 q" 	7Arzz)BQ-'@A 7Q!!(AFFA67 7	7	0 	0	3 	3
7 7s%   !EAE%,"E1E"%E.1E:	c                     d}t         j                  t        j                  |            5 }| j	                  |j                         d       d d d        y # 1 sw Y   y xY w)Ns   cQ ExtraI-. 2Mx   r*  s   Test)r   r5   r   r   r7   r9   )r   gzdatar=   s      r   test_read_with_extrazTestGzip.test_read_with_extraU  sO    < ]]2::f#5]6 	0!QVVXw/	0 	0 	0s   !AAc                 ^   t         j                  | j                  d      5 }|j                  t               d d d        t         j                  | j                  d      5 }|j
                  j                  j                  j                          d d d        y # 1 sw Y   axY w# 1 sw Y   y xY w)NrA   rk   )	r   r   r)   r6   rD   r:  r;  _fpprependrJ   s     r   test_prepend_errorzTestGzip.test_prepend_error]  s~    YYt}}d+ 	qGGEN	YYt}}d+ 	(qIIMM%%'	( 	(	 		( 	(s   B/B#B #B,c                 b   t        j                   dg d      }t        |      |j                  z  }t        j	                  t        j                         d      5 }| j                  |j                  |      |       | j                  |j                         |       d d d        y # 1 sw Y   y xY w)NQ)ry   r      rZ   r  r2   r   )
rg   r8   itemsizer   r5   r   r   r7   r6   r   )r   qLENGTHr=   s       r   test_issue44439zTestGzip.test_issue44439d  s    KK_-Q!**$]]2::<c]: 	/aQWWQZ0QVVXv.	/ 	/ 	/s   AB%%B.c                    t        j                         }d}t        j                  |d      5 }|j	                  |       |j                          |j                         }d d d        |j                         }| j                  t        j                  |      |       | j                  t              5  t        j                         d d d        t        j                  t        j                         }t        j                        }t        j                  |       |j                  |j                               }| j                  ||       y # 1 sw Y   xY w# 1 sw Y   xY w)N   important message here.r2   r   )wbits)r   r   r   r5   r6   rE   r	  r7   rO  rl   rT  r   decompressobj	MAX_WBITS_read_gzip_headerr9   )r   bmessager=   partial_data	full_datarT   read_messages           r   test_flush_flushes_compressorz&TestGzip.test_flush_flushes_compressorl  s	   JJL,]]13]/ 	(1GGGGGI::<L	( JJL	3W= x( 	*OOL)	*dnn_5JJ|$q!||AFFH-w/	( 	(	* 	*s   2E2EEE&c                 z    G d d      }t        j                         } |       }t        j                  |d      5 }||_        |j                          |j                  d       |j                  d       d d d        t        j                  dddg}| j                  |j                  |       y # 1 sw Y   :xY w)	Nc                        e Zd Zd Zd ZddZy)1TestGzip.test_flush_modes.<locals>.FakeCompressorc                     g | _         y r   )modesr   s    r   __init__z:TestGzip.test_flush_modes.<locals>.FakeCompressor.__init__  s	    
r   c                      yNr   r   )r   r:   s     r   r   z:TestGzip.test_flush_modes.<locals>.FakeCompressor.compress  s    r   c                 :    | j                   j                  |       yr  )r}  rt   )r   r;   s     r   rE   z7TestGzip.test_flush_modes.<locals>.FakeCompressor.flush  s    

!!$'r   N))r!   r"   r#   r~  r   rE   r   r   r   FakeCompressorr{    s     r   r  r2   r   rB   r  )	zlib_moder  )
r   r   r   r5   r   rE   r   Z_SYNC_FLUSHr7   r}  )r   r  rs  fcr=   expected_modess         r   test_flush_modeszTestGzip.test_flush_modes  s    	 	 JJL]]13]/ 	#1AJGGIGGBKGGcG"		# 	
 	>2	# 	#s   ;B11B:c                 p   t        j                         }d}t        j                  |d      5 }|j	                  |       |j                  t        |             |j	                  |       d d d        |j                         }| j                  t        j                  |      |dz         y # 1 sw Y   BxY w)Nrn  r2   r   r   )
r   r   r   r5   r6   r    r8   r	  r7   rO  )r   rs  rt  r=   r:   s        r   test_write_seek_writezTestGzip.test_write_seek_write  s     JJL,]]13]/ 	1GGGFF3w< GGG	 zz|.!<	 	s   =B,,B5N)rs  )8r!   r"   r#   r?   rK   rU   r`   rc   rh   rn   rq   rx   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r&  r/  r4  r?  rD  rF  rM  rP  rW  r[  r^  ra  re  rl  rx  r  r  r   r   r   r0   r0   :   s   /
+'8?.&7 S#. $.85-&/	F
5
"&*!58<	11Hf?(7*
F?@57,7943
95	95;KK70(/0*36
=r   r0   c                   B    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zy
)TestOpenc                    t         dz  }t        j                  | j                  d      5 }|j	                  |       d d d        t        | j                  d      5 }t        j                  |j                               }| j                  ||       d d d        t        j                  | j                  d      5 }| j                  |j                         |       d d d        t        j                  | j                  d      5 }|j	                  |       d d d        t        | j                  d      5 }t        j                  |j                               }| j                  ||dz         d d d        | j                  t              5  t        j                  | j                  d       d d d        t        j                  | j                         t        j                  | j                  d      5 }|j	                  |       d d d        t        | j                  d      5 }t        j                  |j                               }| j                  ||       d d d        y # 1 sw Y   $xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   txY w# 1 sw Y   *xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   y xY w)NrB   rA   rk   r   r   r   rD   r   r   r)   r6   rO  r9   r7   rl   r   r   r(   r   r
  r=   	file_datas       r   test_binary_modeszTestOpen.test_binary_modes  s   rzYYt}}d+ 	"qGGL!	"$--& 	6!1IY5	6 YYt}}d+ 	5qQVVX|4	5 YYt}}d+ 	"qGGL!	"$--& 	:!1IYq(89	: / 	+IIdmmT*	+'YYt}}d+ 	"qGGL!	"$--& 	6!1IY5	6 	6)	" 	"	6 	6	5 	5	" 	"	: 	:	+ 	+	" 	"	6 	6_   I6I+8!I8J19J!J/J+6J7I(+I58JJJJ(+J47K c                    t        j                  | j                        }t        j	                  |d      5 }|j                  t        dz         d d d        t        j	                  |d      5 }|j                  t               d d d        t        j	                  |      5 }| j                  |j                         t        dz         d d d        y # 1 sw Y   xY w# 1 sw Y   [xY w# 1 sw Y   y xY w)NrA   rB   r   rN   )	rO   rP   r)   r   r   r6   rD   r7   r9   )r   r)   r=   s      r   test_pathlike_filezTestOpen.test_pathlike_file  s    <<.YYx& 	 !GGEBJ	 YYx& 	!GGEN	YYx  	3AQVVXurz2	3 	3		  	 	 		3 	3s#   C-C (C)CC&)C2c                    t         dz  }t        j                  | j                  d      5 }|j	                  |       d d d        t        | j                  d      5 }t        j                  |j                               }| j                  ||       d d d        t        j                  | j                  d      5 }| j                  |j                         |       d d d        t        j                  | j                  d      5 }|j	                  |       d d d        t        | j                  d      5 }t        j                  |j                               }| j                  ||dz         d d d        | j                  t              5  t        j                  | j                  d       d d d        t        j                  | j                         t        j                  | j                  d      5 }|j	                  |       d d d        t        | j                  d      5 }t        j                  |j                               }| j                  ||       d d d        y # 1 sw Y   $xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   txY w# 1 sw Y   *xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   y xY w)NrB   r2   rk   r3   rM   r   r   r  r  s       r   test_implicit_binary_modesz#TestOpen.test_implicit_binary_modes  s   rzYYt}}c* 	"aGGL!	"$--& 	6!1IY5	6 YYt}}c* 	5aQVVX|4	5 YYt}}c* 	"aGGL!	"$--& 	:!1IYq(89	: / 	*IIdmmS)	*'YYt}}c* 	"aGGL!	"$--& 	6!1IY5	6 	6)	" 	"	6 	6	5 	5	" 	"	: 	:	* 	*	" 	"	6 	6r  c                    t         j                  d      dz  }|j                  dt        j                        }t
        j                  | j                  dd      5 }|j                  |       d d d        t        | j                  d      5 }t
        j                  |j                               j                  d      }| j                  ||       d d d        t
        j                  | j                  dd      5 }| j                  |j                         |       d d d        t
        j                  | j                  dd      5 }|j                  |       d d d        t        | j                  d      5 }t
        j                  |j                               j                  d      }| j                  ||d	z         d d d        y # 1 sw Y   [xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   y xY w)
Nr  rB   
wtr  rk   rtatr   rD   r  replacerH   linesepr   r   r)   r6   rO  r9   r7   r   r
  uncompressed_rawr=   r  s        r   test_text_modeszTestOpen.test_text_modes  s   ||G,r1'//bjjAYYt}}dWY= 	"GGL!	"$--& 	:!188AIY(89	: YYt}}dWY= 	5QVVX|4	5YYt}}dWY= 	"GGL!	"$--& 	>!188AIY(81(<=	> 	>	" 	"	: 	:	5 	5	" 	"	> 	>s>   GAG:!G G,5AG8GG G),G58Hc                    t         dz  }|j                  d      }t        j                  |      }t        j	                  t        j                  |      d      5 }| j                  |j                         |       d d d        t        j	                  t        j                  |      d      5 }| j                  |j                         |       d d d        t        j	                  t        j                  |      dd      5 }| j                  |j                         |       d d d        y # 1 sw Y   xY w# 1 sw Y   jxY w# 1 sw Y   y xY w)NrB   r  r3   rk   r  r  )	rD   r  r   r   r   r   r   r7   r9   )r   uncompressed_bytesuncompressed_strr   r=   s        r   test_fileobjzTestOpen.test_fileobj  s   "RZ-44W=]]#56
YYrzz*-s3 	;qQVVX'9:	;YYrzz*-t4 	;QVVX'9:	;YYrzz*-tgYF 	9!QVVX'78	9 	9		; 	;	; 	;	9 	9s$   !D)+!D5?!E)D25D>E
c                 v   | j                  t              5  t        j                  d       d d d        | j                  t              5  t        j                  | j
                  d       d d d        | j                  t              5  t        j                  | j
                  d       d d d        | j                  t              5  t        j                  | j
                  dd       d d d        | j                  t              5  t        j                  | j
                  dd       d d d        | j                  t              5  t        j                  | j
                  dd	
       d d d        y # 1 sw Y   GxY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   |xY w# 1 sw Y   y xY w)Ngw/^@wbtxbtrk   zutf-8r  ignore)errorsr  )newline)rl   rm   r   r   r   r)   r   s    r   test_bad_paramszTestOpen.test_bad_params  sK   y) 	IIg	z* 	,IIdmmU+	,z* 	,IIdmmU+	,z* 	=IIdmmTGI<	=z* 	<IIdmmT(I;	<z* 	9IIdmmT4I8	9 	9	 		, 	,	, 	,	= 	=	< 	<	9 	9sG   E1	!E>!F#F#F##F/1E;>FFF #F,/F8c                    t         j                  d      dz  }|j                  dt        j                        }t
        j                  | j                  dd      5 }|j                  |       d d d        t        | j                  d      5 }t
        j                  |j                               j                  d      }| j                  ||       d d d        t
        j                  | j                  dd      5 }| j                  |j                         |       d d d        y # 1 sw Y   xY w# 1 sw Y   axY w# 1 sw Y   y xY w)	Nr  rB   r  r  zutf-16r  rk   r  r  r  s        r   test_encodingzTestOpen.test_encoding  s   ||G,r1'//bjjAYYt}}dXY> 	"!GGL!	"$--& 	:!188BIY(89	: YYt}}dXY> 	5!QVVX|4	5 	5	" 	"	: 	:	5 	5s%   D$AD0:!D<$D-0D9<Ec                 @   t         j                  | j                  d      5 }|j                  d       d d d        t         j                  | j                  ddd      5 }| j	                  |j                         d       d d d        y # 1 sw Y   VxY w# 1 sw Y   y xY w)NrA   s   foobarr  r  r  )r  r  foobar)r   r   r)   r6   r7   r9   rJ   s     r   test_encoding_error_handlerz$TestOpen.test_encoding_error_handler   s    YYt}}d+ 	#qGGM"	#YYt}}dWXYN 	1QVVXx0	1 	1	# 	#	1 	1s   B!BBBc                 x   t         j                  d      dz  }t        j                  | j                  ddd      5 }|j                  |       d d d        t        j                  | j                  ddd      5 }| j                  |j                         |g       d d d        y # 1 sw Y   WxY w# 1 sw Y   y xY w)Nr  rB   r  r  )r  r  r  )rD   r  r   r   r)   r6   r7   r   )r   r
  r=   s      r   test_newlinezTestOpen.test_newline(  s    ||G,r1YYt}}dWdYK 	"qGGL!	"YYt}}dWdYK 	<qQ[[]\N;	< 	<	" 	"	< 	<s   B$9"B0$B-0B9N)r!   r"   r#   r  r  r  r  r  r  r  r  r  r   r   r   r  r    s/    66368> 	99
51<r   r  c                       fd}|S )Nc                 F     t        j                          fd       }|S )Nc                      t        j                         	  | i |t        j                         S # t        j                         w xY wr   )rH   makedirsr   rmtree)r   kwargs	directoryfunctions     r   wrapperz?create_and_remove_directory.<locals>.decorator.<locals>.wrapper3  s>    KK	",00  +	  +s	   5 A)	functoolswraps)r  r  r  s   ` r   	decoratorz.create_and_remove_directory.<locals>.decorator2  s%    		"	, 
#	, r   r   )r  r  s   ` r   create_and_remove_directoryr  1  s     r   c                       e Zd ZdZ e       d        Z ee      d        Zd Z	 e        ee      d               Z
 ee      d        Z ee      d        Zd Zd	 Zy
)TestCommandLines   This is a simple test with gzipc                    t        j                         5 }t        j                  |d      5 }|j	                  | j
                         d d d        t        j                  dddf}t        |t        t        t              5 }|j                  |j                               \  }}d d d        d d d        | j                  d       | j                  | j
                         y # 1 sw Y   xY w# 1 sw Y   LxY w# 1 sw Y   PxY w)NrA   r   -mr   -dstdinstdoutstderrr   )r   r   r   r5   r6   r:   sys
executabler   r   communicater	  r7   )r   bytes_io	gzip_filer   procouterrs          r   test_decompress_stdin_stdoutz,TestCommandLine.test_decompress_stdin_stdoutA  s    ZZ\ 	AXxd; +y		*+ >>45Dt4TB Ad++H,=,=,?@SA	A 	c"dii(+ +A A	A 	As:   C:C"	7C: #C.#C:"C+	'C:.C7	3C::Dc                    t         j                  j                  t        d      }| j	                  t         j                  j                  |             t        j                  |d      5 }|j                  | j                         d d d        t        ddd|      \  }}}t        t         j                  j                  t        d      d      5 }| j                  |j                         | j                         d d d        | j                  t         j                  j                  |             | j                  |d	       | j                  |d
       | j                  |d
       y # 1 sw Y   xY w# 1 sw Y   zxY w)Nztestgzip.gzrA   )r;   r  r   r  testgziprk   r   r   )rH   pathru   TEMPDIRr   existsr   r   r6   r:   r
   r7   r9   r   )r   gzipnamefprcr  r  gunzipeds          r   test_decompress_infile_outfilez.TestCommandLine.test_decompress_infile_outfileN  s   77<<712YYxdY+ 	 rHHTYY	 'fdHEC"'',,w
3T: 	9hX]]_dii8	9 	x01Qc"c"	  	 	9 	9s   *E&+E2&E/2E;c                     t        dddd      \  }}}| j                  d|j                                | j                  |d       | j                  |d       y )Nr  r   r  zthisisatest.outs.   filename doesn't end in .gz: 'thisisatest.out'ry   r   )r   r7   stripr   r  r  r  s       r   $test_decompress_infile_outfile_errorz4TestCommandLine.test_decompress_infile_outfile_error_  sP    ,T64ARSCJCIIKXQc"r   c                    t         j                  ddf}t        |t        t        t              5 }|j	                  | j
                        \  }}d d d        | j                  d       | j                  d d d       y # 1 sw Y   1xY w)Nr  r   r  r   r   r   )r  r  r   r   r  r:   r7   )r   r   r  r  r  s        r   test_compress_stdin_outfilez+TestCommandLine.test_compress_stdin_outfilee  sy     ~~tV+4tD> 	3$''		2HC	3 	c"Ra+.		3 	3s   A>>Bc                    t         j                  j                  t        d      }|dz   }| j	                  t         j                  j                  |             t        |d      5 }|j                  | j                         d d d        t        dd|      \  }}}| j                  t         j                  j                  |             | j                  |d       | j                  |d       y # 1 sw Y   mxY w)Nr  .gzrA   r  r   r   )rH   r  ru   r  r   r  r   r6   r:   r
   r   r7   )r   local_testgzipr  r  r  r  r  s          r   $test_compress_infile_outfile_defaultz4TestCommandLine.test_compress_infile_outfile_defaulto  s    gz:!E)12.$' 	 2HHTYY	  (fnECx01c"c"	  	 s   $C,,C5c                    dD ]L  }| j                  |      5  t        j                  j                  t        d      }|dz   }| j                  t        j                  j                  |             t        |d      5 }|j                  | j                         d d d        t        dd||      \  }}}| j                  t        j                  j                  |             | j                  |d       | j                  |d       t        j                  |       | j                  t        j                  j                  |             d d d        O y # 1 sw Y   xY w# 1 sw Y   gxY w)	N)--fast--best)compress_levelr  r  rA   r  r   r   )r   rH   r  ru   r  r   r  r   r6   r:   r
   r   r7   remove)r   r  r  r  r  r  r  r  s           r   test_compress_infile_outfilez,TestCommandLine.test_compress_infile_outfile~  s   2 	;N^< ;!#gz!B)E1  !9:.$/ (2HHTYY'(  0fnn]Cx 89  c*  c*		(#  !9:; ;	;( (; ;s%   A$E =EB/E EE  E*	c                 p    t        dddd      \  }}}| j                  d|       | j                  |d       y )Nr  r   r  r  s8   error: argument --best: not allowed with argument --fastr   r   rI  r7   r  s       r   %test_compress_fast_best_are_exclusivez5TestCommandLine.test_compress_fast_best_are_exclusive  s8    ,T68XNCQSVWc"r   c                 p    t        dddd      \  }}}| j                  d|       | j                  |d       y )Nr  r   r  r  sA   error: argument -d/--decompress: not allowed with argument --fastr   r  r  s       r   -test_decompress_cannot_have_flags_compressionz=TestCommandLine.test_decompress_cannot_have_flags_compression  s8    ,T68TJCZ\_`c"r   N)r!   r"   r#   r:   r	   r  r  r  r  r  r  r  r  r  r  r   r   r   r  r  >  s    -D
) 
) !)# *# #  )/ * / !)# *# !); *;$#
#r   r  __main__)'rg   r  r   rH   rO   r   r  unittest
subprocessr   r   test.supportr   r   r   r   r	   test.support.script_helperr
   r   import_moduler   r   rD   r   r  abspathr.   r  r   r   TestCaser%   r0   r  r  r  r!   mainr   r   r   <module>r     s      	 	   
  " & " = = N"}""6*"}""6*		 ''//)**
+h
6&2:: &(x   (l	=x l	=^E<x E<P
[#h'' [#| zHMMO r   