
    z%iA`                       d dl Z d dlZd dlmZmZmZ d dlZd dlZd dlZd dl	Z	d dl
Z
d dlmZ d dlZd dlmZmZ d dlmZ d dlmZmZ  ed      Zd dlmZmZmZmZ  G d	 d
ej6                        Z G d dej6                        Z G d d      Z G d dej6                        Z G d dej6                        Z  G d dej6                        Z!dZ"dZ#dZ$dZ%ejL                  ddgZ'dZ(ejR                  ddejL                  ejT                  ejV                  z  dgZ,dZ-ej\                  dd d!ejL                  igZ/d"Z0ejR                  d#dejb                  d$d ejL                  d#dd%gZ2d&Z3d'Z4e5d(k(  r ejl                          yy))    N)BytesIOUnsupportedOperationDEFAULT_BUFFER_SIZE)support)_4G
bigmemtest)import_module)TESTFNunlinklzma)LZMACompressorLZMADecompressor	LZMAErrorLZMAFilec                   n   e Zd Zd Zd Zd Zd Zd'dZd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zej@                   e!e"dz   d      d                Z#ej@                   e!e"dz   d!      d"               Z$d# Z%ejL                  d$        Z'd% Z(y&)(CompressorDecompressorTestCasec                 f   | j                  t        t        g        | j                  t        t        d       | j                  t        t        d       | j                  t        t        d       | j                  t        t        d       | j                  t        t        t        j
                         | j                  t              5  t        d	d
t        j                  ig       d d d        | j                  t        t        d       | j                  t        t        d       | j                  t              5  t        t        j                  d       d d d        | j                  t              5  t        t        j                  d       d d d        | j                  t        t        t               | j                  t              5  t        t        j                  t               d d d        | j                  t              5  t        t        j                  t               d d d        t               }| j                  t        |j                         | j                  t        |j                  dd       | j                  t        |j                  d       |j                         }| j                  t        |j                  d       | j                  t        |j                         t               }| j                  t        |j                         | j                  t        |j                  dd       |j                  |       | j                  t        |j                  d       y # 1 sw Y   xY w# 1 sw Y   'xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   {xY w)Ng@format checkasdfpreset   filters   idr   r    s   qwmemlimitzzz   r   r      foo   bars   blahs   quux)assertRaises	TypeErrorr   
ValueErrorr   FORMAT_AUTOFILTER_LZMA2r   
FORMAT_RAWFILTERS_RAW_1	FORMAT_XZFORMAT_ALONEcompressflush
decompressEOFError)selflzcemptylzds       B/home/uftp/.pyenv/versions/3.12.0/lib/python3.12/test/test_lzma.pytest_simple_bad_argsz3CompressorDecompressorTestCase.test_simple_bad_args   s   )^R8)^DA)^2>)^FC)^Q?*nT=M=MNz* 	J!tT5F5F.G-HI	J 	)%5r:)%5Fy) 	=T__e<	= z* 	BT__yA	B 	*&6Nz* 	KDNNMJ	Kz* 	ND$5$5}M	N )S\\2)S\\66B)SYY8		*cllG<*cii0 )S^^4)S^^VVDu(CNNG<;	J 	J
	= 	=	B 	B	K 	K	N 	Ns<   M2>M?7N N N&2M<?N	NN#&N0c                 j   | j                  t        t        dg       | j                  t        t        ddig       | j                  t        t        ddig       | j                  t              5  t        t        j
                  ddg       d d d        | j                  t              5  t        t        j                  ddg       d d d        | j                  t              5  t        t        j                  ddg       d d d        y # 1 sw Y   xY w# 1 sw Y   RxY w# 1 sw Y   y xY w)	N   wobsiter   xyzzyr   r    ́ r   r    foo)r*   r+   r   r,   r   r.   FILTER_DELTA
FILTER_X86r7   s    r;   test_bad_filter_specz3CompressorDecompressorTestCase.test_bad_filter_specB   s
   )^j\J*n|nM*ne}oNz* 	J4+<+<Q$G#HI	Jz* 	J4+<+<Q$G#HI	Jz* 	H4??1$E#FG	H 	H		J 	J	J 	J	H 	Hs$   1D-D)D)DD&)D2c                     t               }|j                  t               | j                  t        |j                  d       y )Ns   nyan)r   r5   COMPRESSED_XZr*   r6   r7   r:   s     r;   test_decompressor_after_eofz:CompressorDecompressorTestCase.test_decompressor_after_eofM   s,     }%(CNNG<    c                 f   t        d      }| j                  t        |j                  t               t        t
        j                  d      }| j                  t        |j                  t               t        t
        j                  d      }| j                  t        |j                  t               y )N   r#   )	r   r*   r   r5   rH   r   r1   r2   COMPRESSED_ALONErI   s     r;   test_decompressor_memlimitz9CompressorDecompressorTestCase.test_decompressor_memlimitR   sq    -)S^^]Ct~~=)S^^]Ct004@)S^^5EFrK   c                 .   | j                  |j                         |j                  |      }| j                  |t               | j                  |j
                  |       | j                  |j                         | j                  |j                  |       y N)assertFalseeofr5   assertEqualINPUTr   
assertTrueunused_data)r7   r:   datar   rW   outs         r;   _test_decompressorz1CompressorDecompressorTestCase._test_decompressor^   sj    !nnT"e$E* +6rK   c                     t               }| j                  |t        t        j                         t               }| j                  |t
        t        j                         y rQ   )r   rZ   rH   r   CHECK_CRC64rN   
CHECK_NONErI   s     r;   test_decompressor_autoz5CompressorDecompressorTestCase.test_decompressor_autof   sA     ]D4D4DE %5tGrK   c                     t        t        j                        }| j                  |t        t        j
                         y rQ   )r   r   r1   rZ   rH   r\   rI   s     r;   test_decompressor_xzz3CompressorDecompressorTestCase.test_decompressor_xzm   s(    t~~.]D4D4DErK   c                     t        t        j                        }| j                  |t        t        j
                         y rQ   )r   r   r2   rZ   rN   r]   rI   s     r;   test_decompressor_alonez6CompressorDecompressorTestCase.test_decompressor_aloneq   s)    t001%5tGrK   c                     t        t        j                  t              }| j	                  |t
        t        j                         y Nr   )r   r   r/   r0   rZ   COMPRESSED_RAW_1r]   rI   s     r;   test_decompressor_raw_1z6CompressorDecompressorTestCase.test_decompressor_raw_1u   )    tF%5tGrK   c                     t        t        j                  t              }| j	                  |t
        t        j                         y rd   )r   r   r/   FILTERS_RAW_2rZ   COMPRESSED_RAW_2r]   rI   s     r;   test_decompressor_raw_2z6CompressorDecompressorTestCase.test_decompressor_raw_2y   rg   rK   c                     t        t        j                  t              }| j	                  |t
        t        j                         y rd   )r   r   r/   FILTERS_RAW_3rZ   COMPRESSED_RAW_3r]   rI   s     r;   test_decompressor_raw_3z6CompressorDecompressorTestCase.test_decompressor_raw_3}   rg   rK   c                     t        t        j                  t              }| j	                  |t
        t        j                         y rd   )r   r   r/   FILTERS_RAW_4rZ   COMPRESSED_RAW_4r]   rI   s     r;   test_decompressor_raw_4z6CompressorDecompressorTestCase.test_decompressor_raw_4   rg   rK   c           	         t               }g }t        dt        t              d      D ]G  }| j	                  |j
                         |j                  |j                  t        ||dz                 I dj                  |      }| j                  |t               | j                  |j                  t        j                         | j                  |j
                         | j                  |j                  d       y Nr   
   rK   r   rangelenrH   rR   rS   appendr5   joinrT   rU   r   r   r\   rV   rW   r7   r:   rY   is       r;   test_decompressor_chunksz7CompressorDecompressorTestCase.test_decompressor_chunks   s     q#m,b1 	>ASWW%JJs~~mAad&;<=	> hhsme$D$4$45 #.rK   c           	         t               }g }t        dt        t              d      D ]  }| j	                  |j
                         |j                  |j                  d             |j                  |j                  d             |j                  |j                  d             |j                  |j                  t        ||dz                  dj                  |      }| j                  |t               | j                  |j                  t        j                         | j                  |j
                         | j                  |j                  d       y ru   rw   r|   s       r;   test_decompressor_chunks_emptyz=CompressorDecompressorTestCase.test_decompressor_chunks_empty   s     q#m,b1 	>ASWW%JJs~~c*+JJs~~c*+JJs~~c*+JJs~~mAad&;<=	> hhsme$D$4$45 #.rK   c                    t               }d}g }t        t              dz  }|j                  |j	                  t        d | |             | j                  |j                         | j                  t        |d         |       |j                  |j	                  d|             | j                  |j                         | j                  t        |d         |       |j                  |j	                  t        |d  |             | j                  t        |d         |       |j                  sM|j                  |j	                  d|             | j                  t        |d         |       |j                  sMdj                  |      }| j                  |t               | j                  |j                  t        j                         | j                  |j                  d       y )Nd      
max_lengthrK   )r   ry   rH   rz   r5   rR   needs_inputrT   assertLessEqualrS   r{   rU   r   r   r\   rW   )r7   r:   r   rY   len_s        r;    test_decompressor_chunks_maxsizez?CompressorDecompressorTestCase.test_decompressor_chunks_maxsize   s    
 =!Q&

3>>-"6-7 " 9 	:)SWz2 	

3>>#*>=>)SWz2 	

3>>-"6-7 " 9 	:SR\:6 ''JJs~~cj~AB  SWz: '' hhsme$D$4$45#.rK   c                    t               }g }| j                  |j                  t        d d d      d       |j	                  |j                  dd             |j	                  |j                  t        dd d             |j	                  |j                  t        dd               | j                  dj                  |      t               y )Nr   r   r   rK   r   i      r   rT   r5   rH   rz   r{   rU   r7   r:   rY   s      r;   test_decompressor_inputbuf_1z;CompressorDecompressorTestCase.test_decompressor_inputbuf_1   s       	ds(;34 ( 67:	<
 	

3>>#q)* 	

3>>-C"8"=> 	

3>>-"567#.rK   c                    t               }g }| j                  |j                  t        d d d      d       |j	                  |j                  d             |j	                  |j                  t        dd d             |j	                  |j                  t        dd d             |j	                  |j                  t        dd               | j                  dj                  |      t               y )N   r   r   rK   i  r   ,  r   r   s      r;   test_decompressor_inputbuf_2z;CompressorDecompressorTestCase.test_decompressor_inputbuf_2   s       	ds(;34 ( 67:	<

3>>#&' 	

3>>-C"8!<= 	

3>>-C"8!<= 	

3>>-"567#.rK   c                 T   t               }g }|j                  |j                  t        d d d             |j                  |j                  t        dd d             |j                  |j                  t        dd               | j	                  dj                  |      t               y )Nr      r   rK   )r   rz   r5   rH   rT   r{   rU   r   s      r;   test_decompressor_inputbuf_3z;CompressorDecompressorTestCase.test_decompressor_inputbuf_3   s       	

3>>-"5q9: 	

3>>-C"8!<= 	

3>>-"567#.rK   c                 p    t               }d}| j                  |t        |z   t        j                  |       y )Ns	   fooblibarrW   )r   rZ   rH   r   r\   )r7   r:   extras      r;   test_decompressor_unused_dataz<CompressorDecompressorTestCase.test_decompressor_unused_data   s6     ]U%:D<L<L,1 	  	3rK   c                    t               }| j                  t        |j                  t               t        t
        j                        }| j                  t        |j                  t               t        t
        j                        }| j                  t        |j                  t               t        t
        j                  t              }| j                  t        |j                  t               y rd   )r   r*   r   r5   re   r   r1   rN   r2   rH   r/   r0   rI   s     r;   test_decompressor_bad_inputz:CompressorDecompressorTestCase.test_decompressor_bad_input  s     )S^^5EFt~~.)S^^5EFt001)S^^]CtF)S^^]CrK   c                     t               }| j                  t        |j                  t               | j                  t        |j                  t               y rQ   )r   r*   r   r5   re   rI   s     r;   test_decompressor_bug_28275z:CompressorDecompressorTestCase.test_decompressor_bug_28275  s8     )S^^5EF)S^^5EFrK   c                     t               }|j                  t              |j                         z   }t	               }| j                  ||t        j                         y rQ   )r   r3   rU   r4   r   rZ   r   r\   r7   r8   cdatar:   s       r;   test_roundtrip_xzz0CompressorDecompressorTestCase.test_roundtrip_xz  sC    U#ciik1 UD,<,<=rK   c                     t        t        j                        }|j                  t              |j                         z   }t               }| j                  ||t        j                         y rQ   )	r   r   r2   r3   rU   r4   r   rZ   r]   r   s       r;   test_roundtrip_alonez3CompressorDecompressorTestCase.test_roundtrip_alone  sI    T../U#ciik1 UDOO<rK   c                    t        t        j                  t              }|j	                  t
              |j                         z   }t        t        j                  t              }| j                  ||t        j                         y rd   
r   r   r/   rq   r3   rU   r4   r   rZ   r]   r   s       r;   test_roundtrip_rawz1CompressorDecompressorTestCase.test_roundtrip_raw#  sQ    T__mDU#ciik1tFUDOO<rK   c                    t        t        j                  t              }|j	                  t
              }||j	                  d      z  }||j	                  d      z  }||j	                  d      z  }||j                         z  }t        t        j                  t              }| j                  ||t        j                         y )Nr   rK   r   r   s       r;   test_roundtrip_raw_emptyz7CompressorDecompressorTestCase.test_roundtrip_raw_empty)  s    T__mDU#c""c""c""tFUDOO<rK   c           	      d   t               }g }t        dt        t              d      D ],  }|j	                  |j                  t        ||dz                 . |j	                  |j                                dj                  |      }t               }| j                  ||t        j                         y ru   r   rx   ry   rU   rz   r3   r4   r{   r   rZ   r   r\   r7   r8   r   r}   r:   s        r;   test_roundtrip_chunksz4CompressorDecompressorTestCase.test_roundtrip_chunks3  s    q#e*b) 	6ALLeAadm45	6SYY[! UD,<,<=rK   c           	      $   t               }g }t        dt        t              d      D ]  }|j	                  |j                  t        ||dz                 |j	                  |j                  d             |j	                  |j                  d             |j	                  |j                  d              |j	                  |j                                dj                  |      }t               }| j                  ||t        j                         y ru   r   r   s        r;   test_roundtrip_empty_chunksz:CompressorDecompressorTestCase.test_roundtrip_empty_chunks=  s    q#e*b) 	,ALLeAadm45LLc*+LLc*+LLc*+		,
 	SYY[! UD,<,<=rK   c                 |    t               }| j                  |t        t        z   t        j
                  t               y )Nr   )r   rZ   rH   rN   r   r\   rI   s     r;   test_decompressor_multistreamz<CompressorDecompressorTestCase.test_decompressor_multistreamL  s4     ]5E%E $ 0 0>N 	  	PrK   r   r   )sizememusec                 *   t               }|j                  d|z        |j                         z   }t        j	                  |      }	 | j                  t        |      |       | j                  t        |j                  d            d       d }y # d }w xY w)N   xr   )r   r3   r4   r   r5   rT   ry   strip)r7   r   r8   r   ddatas        r;   test_compressor_bigmemz5CompressorDecompressorTestCase.test_compressor_bigmemS  sy     TD[)CIIK7&	SZ.ST!23Q7EDEs   AB Br   c                 
   t               }t        d|      }t        j                  |      }	 ||dz
  |z  dz   z  }t        j                  |      }|j                  |      }| j                  ||       d x}x}}y # d x}x}}w xY w)Ni      )r   minrandom	randbytesr   r3   r5   rT   )r7   r   r:   	blocksizeblockinputr   r   s           r;   test_decompressor_bigmemz7CompressorDecompressorTestCase.test_decompressor_bigmem_  s      ($/	  +	)d1f2Q67EMM%(ENN5)EUE*$((E(EED(E(EEs   AA: :Bc                 f   t        t        j                  dz         D ]z  }| j                  t              5  t        j
                  t               |       d d d        | j                  t              5  t        j
                  t               |       d d d        | y # 1 sw Y   HxY w# 1 sw Y   xY wNr   )rx   pickleHIGHEST_PROTOCOLr*   r+   dumpsr   r   )r7   protos     r;   test_picklez*CompressorDecompressorTestCase.test_pickleo  s    622Q67 	8E""9- 6^-u56""9- 8-/78 8	86 68 8s   B1B'B$	'B0	c                     t        j                  t        d      }t               } |       }t	        d      D ]  }|j                           | j                   |       |z
  dd       y )Ngettotalrefcountr   r   rv   )delta)r   get_attributesysr   rx   __init__assertAlmostEqual)r7   r   r:   refs_beforer}   s        r;   &test_refleaks_in_decompressor___init__zECompressorDecompressorTestCase.test_refleaks_in_decompressor___init__v  s`    "006HI &(s 	ALLN	/1K?"MrK   c                     | j                  t        j                  t              j                  t	                     d       y NrK   )rT   r   __new__r5   bytesrE   s    r;   )test_uninitialized_LZMADecompressor_crashzHCompressorDecompressorTestCase.test_uninitialized_LZMADecompressor_crash  s-    )112BC#EG,c	3rK   NrK   ))__name__
__module____qualname__r<   rF   rJ   rO   rZ   r^   r`   rb   rf   rk   ro   rs   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   skip_if_pgo_taskr   r   r   r   r   refcount_testr   r   r"   rK   r;   r   r      s   &=P	H=
G7HFHHHHH
///@/,/*/ 3DG>===>>P S3Yq) *  S3Yq)
) * 
)8 N N3rK   r   c                   B    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zy
)"CompressDecompressFunctionTestCasec                    | j                  t        t        j                         | j                  t        t        j                  g        | j                  t        t        j                  dd       | j                  t        t        j                  dd       | j                  t        t        j                  dd       | j                  t        t        j                  dd	       | j                  t              5  t        j                  dd
dt        j
                  ig       d d d        | j                  t        t        j                         | j                  t        t        j                  g        | j                  t        t        j                  dd       | j                  t        t        j                  dd       | j                  t              5  t        j                  dt        j                  i        d d d        | j                  t              5  t        j                  dt        j                  d       d d d        | j                  t              5  t        j                  dt        	       d d d        | j                  t              5  t        j                  dt        j                  t               d d d        | j                  t              5  t        j                  dt        j                  t               d d d        y # 1 sw Y   xY w# 1 sw Y   %xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   y xY w)NrK   xzr   noner   blahr   rM   r   r   r    r!   r   g   1Ar#   r'   r&   r   r$   )r*   r+   r   r3   r,   r.   r5   r/   r0   r1   r2   rE   s    r;   test_bad_argsz0CompressDecompressFunctionTestCase.test_bad_args  s{   )T]]3)T]]B7)T]]CE)T]]CvF)T]]CG)T]]CFz* 	NMM#a49J9J2K1LMM	N 	)T__5)T__b9)T__c&I)T__cEJy) 	EOOCOD	E z* 	MOOC)OL	M z* 	8OOCO7	8z* 	OOOCON	Oz* 	JOO 1 1=  J	J 	J#	N 	N	E 	E	M 	M	8 	8	O 	O	J 	JsH   ;*L'L#'L0!L<+M"+ML #L-0L9<MMMc                    | j                  t              5  t        j                  t        d       d d d        | j                  t              5  t        j                  t        t        j
                  d       d d d        | j                  t              5  t        j                  t        t        j                  d       d d d        y # 1 sw Y   xY w# 1 sw Y   ^xY w# 1 sw Y   y xY w)NrM   r#   r   )r*   r   r   r5   rH   r1   rN   r2   rE   s    r;   test_decompress_memlimitz;CompressDecompressFunctionTestCase.test_decompress_memlimit  s    y) 	:OOMDO9	:y) 	IOO!$..4  I	I y) 	OOO$T->->  O	O 	O	: 	:	I 	I	O 	Os#   C+C+C#CC #C,c                    t         j                  t              }| j                  |t               t         j                  t
              }| j                  |t               t         j                  t        t         j                        }| j                  |t               t         j                  t
        t         j                        }| j                  |t               t         j                  t        t         j                  t              }| j                  |t               t         j                  t        t         j                  t              }| j                  |t               t         j                  t        t         j                  t              }| j                  |t               t         j                  t        t         j                  t               }| j                  |t               y rd   )r   r5   rH   rT   rU   rN   r1   r2   re   r/   r0   rj   ri   rn   rm   rr   rq   r7   r   s     r;   test_decompress_good_inputz=CompressDecompressFunctionTestCase.test_decompress_good_input  sF   .& 01&t~~>& 0$2C2CD& $//=   J& $//=   J& $//=   J& $//=   J&rK   c                    | j                  t        t        j                  t        d d        | j                  t        t        j                  t
        d d        | j                  t        t        j                  t        d d t        j                  t               | j                  t        t        j                  t        d d t        j                  t               | j                  t        t        j                  t        d d t        j                  t               | j                  t        t        j                  t        d d t        j                  t               y )N   r'   )r*   r   r   r5   rH   rN   re   r/   r0   rj   ri   rn   rm   rr   rq   rE   s    r;    test_decompress_incomplete_inputzCCompressDecompressFunctionTestCase.test_decompress_incomplete_input  s    )T__mDS6IJ)T__6Ft6LM)T__6Ft6L!%- 	 	I)T__6Ft6L!%- 	 	I)T__6Ft6L!%- 	 	I)T__6Ft6L!%- 	 	IrK   c                    | j                  t              5  t        j                  t               d d d        | j                  t              5  t        j                  t
               d d d        | j                  t              5  t        j                  t        t        j                         d d d        | j                  t              5  t        j                  t        t        j                         d d d        | j                  t              5  t        j                  t        t        j                  t               d d d        y # 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   {xY w# 1 sw Y   y xY wNr   r'   )r*   r   r   r5   COMPRESSED_BOGUSre   rN   r1   rH   r2   r/   r0   rE   s    r;   test_decompress_bad_inputz<CompressDecompressFunctionTestCase.test_decompress_bad_input  s   y) 	.OO,-	.y) 	.OO,-	.y) 	EOO,T^^OD	Ey) 	EOOM$2C2COD	Ey) 	3OOM$//$1  3	3 	3	. 	.	. 	.	E 	E	E 	E	3 	3s;   E
E*E#*E//E;
EE #E,/E8;Fc                    t         j                  t              }t         j                  |      }| j	                  |t               t         j                  t        t         j
                        }t         j                  |      }| j	                  |t               t         j                  t        t         j                        }t         j                  |      }| j	                  |t               t         j                  t        t         j                  t              }t         j                  |t         j                  t              }| j	                  |t               y rd   )	r   r3   rU   r5   rT   r1   r2   r/   rq   )r7   r   r   s      r;   test_roundtripz1CompressDecompressFunctionTestCase.test_roundtrip  s    e$&&eT^^4&&eT%6%67&&eT__mLtN&rK   c                 v    t         j                  t        t        z         }| j	                  |t
        dz         y )Nr   )r   r5   rH   rN   rT   rU   r   s     r;   test_decompress_multistreamz>CompressDecompressFunctionTestCase.test_decompress_multistream  s*    0@ @A	*rK   c                 p    t         j                  t        t        z         }| j	                  |t
               y rQ   r   r5   rH   r   rT   rU   r   s     r;   test_decompress_trailing_junkz@CompressDecompressFunctionTestCase.test_decompress_trailing_junk  s&    0@ @A&rK   c                 |    t         j                  t        dz  t        z         }| j	                  |t
        dz         y )Nr   r   r   s     r;   )test_decompress_multistream_trailing_junkzLCompressDecompressFunctionTestCase.test_decompress_multistream_trailing_junk  s/     14D DE	*rK   N)r   r   r   r   r   r   r   r   r   r   r   r   r"   rK   r;   r   r     s2    J:O':
I3'&+'+rK   r   c                   "    e Zd Z	 ddZd Zd Zy)TempFilec                      || _         || _        y rQ   )filenamerX   )r7   r   rX   s      r;   r   zTempFile.__init__  s     	rK   c                     t        | j                  d      5 }|j                  | j                         d d d        y # 1 sw Y   y xY w)Nwb)openr   writerX   r7   fs     r;   	__enter__zTempFile.__enter__  s7    $--& 	!GGDII	 	 	s	   <Ac                 .    t        | j                         y rQ   )r   r   )r7   argss     r;   __exit__zTempFile.__exit__  s    t}}rK   Nr   )r   r   r   r   r  r  r"   rK   r;   r   r     s    GrK   r   c                      e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd 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 Z7d6 Z8d7 Z9d8 Z:d9 Z;d: Z<d; Z=d< Z>d= Z?d> Z@y?)@FileTestCasec                 \   t        t        t                    5 }	 d d d        t        t               d      5 }	 d d d        t        t               d      5 }	 d d d        t        t               d      5 }	 d d d        y # 1 sw Y   dxY w# 1 sw Y   RxY w# 1 sw Y   @xY w# 1 sw Y   y xY w)Nwxa)r   r   rH   r  s     r;   	test_initzFileTestCase.test_init  s    gm,- 		gi% 		gi% 		gi% 		 		 		 		 		 	s.   A>B
B3B">B
BB"B+c                    t        j                  t              }t        |t              5  t        |      5 }| j                  |j                         t               d d d        t        |d      5 }|j                  t               d d d        t        |      5 }| j                  |j                         t        dz         d d d        d d d        y # 1 sw Y   wxY w# 1 sw Y   YxY w# 1 sw Y   *xY w# 1 sw Y   y xY w)Nr  r   )
pathlibPathr
   r   rH   r   rT   readrU   r  )r7   r   r  s      r;    test_init_with_PathLike_filenamez-FileTestCase.test_init_with_PathLike_filename&  s    <<'h. 	6(# 2q  512(C( A(# 6q  51956	6 	62 2 6 6	6 	6sR   C5%CC5/CC5(C) C5C	C5C&	"C5)C2	.C55C>c                 8   t        t        t              5  t        t              5 }	 d d d        t        t        d      5 }	 d d d        t        t        d      5 }	 d d d        d d d        y # 1 sw Y   FxY w# 1 sw Y   8xY w# 1 sw Y   *xY w# 1 sw Y   y xY w)Nr  r  )r   r
   rH   r   r  s     r;   test_init_with_filenamez$FileTestCase.test_init_with_filename0  s    fm, 	&! Q&#& !&#& !	 	   	 	sP   BA,BA8BBB,A5	1B8B	=BB		BBc                    t        t              5  t        t        d      5  	 d d d        t        t        d      5  	 d d d        t        t        d      5  	 d d d        t        t        d      5  	 d d d        t        t        d      5  	 d d d        t        t        d      5  	 d d d        d d d        y # 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xxY w# 1 sw Y   jxY w# 1 sw Y   \xY w# 1 sw Y   NxY w# 1 sw Y   y xY w)Nrrbr  r   r  ab)r   r
   r   rE   s    r;   test_init_modezFileTestCase.test_init_mode9  s    f 	&#& &$' &#& &$' &#& &$' 	 	      	 	s   C>B6C>CC>CC>/C1C>	C&C>#C2%C>6B?	;C>C	C>C	C>C#	C>&C/	+C>2C;	7C>>Dc                 P   | j                  t        t               dD ]c  }t        t               t        t        |      5  	 d d d        | j	                  t
              5  t        t        |      5  	 d d d        d d d        e y # 1 sw Y   DxY w# 1 sw Y    xY w# 1 sw Y   xY w)N)r  xb)
addCleanupr   r
   r   r*   FileExistsError)r7   modes     r;   test_init_with_x_modez"FileTestCase.test_init_with_x_modeH  s    ' 	D6N&$' ""?3 fd+  		   s/   BB/B1BB	BBB%	c                    | j                  t              5  t        t        t              d       d d d        | j                  t              5  t        t        t              d       d d d        | j                  t              5  t        t        t              d       d d d        | j                  t              5  t        t        t              d       d d d        | j                  t              5  t        t        t              d       d d d        | j                  t              5  t        t        t              d       d d d        | j                  t              5  t        t        t              d       d d d        | j                  t              5  t        t        t              d       d d d        | j                  t              5  t        t        t              d	       d d d        | j                  t              5  t        t        t              d
       d d d        | j                  t              5  t        t        t              d       d d d        y # 1 sw Y   1xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   _xY w# 1 sw Y   5xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   y xY w)N)r   r  r   xtzx+rxwxrtzr+wtzw+rw)r*   r,   r   r   rH   rE   s    r;   test_init_bad_modezFileTestCase.test_init_bad_modeR  s-   z* 	7W]+X6	7z* 	1W]+R0	1z* 	3W]+T2	3z* 	3W]+T2	3z* 	3W]+T2	3z* 	3W]+T2	3z* 	3W]+T2	3z* 	3W]+T2	3z* 	3W]+T2	3z* 	3W]+T2	3z* 	3W]+T2	3 	3)	7 	7	1 	1	3 	3	3 	3	3 	3	3 	3	3 	3	3 	3	3 	3	3 	3	3 	3s   II,I9;J2J)J  J-J:KK<KI),I69JJJ J*-J7:KKKK(c                     | j                  t              5  t        t               dd       d d d        | j                  t              5  t        t               dt
        j                         d d d        | j                  t              5  t        t               dt
        j                  dz          d d d        | j                  t              5  t        t        t              t
        j                         d d d        | j                  t              5  t        t        t              t
        j                         d d d        | j                  t              5  t        t        t              t
        j                         d d d        | j                  t              5  t        t        t              t
        j                         d d d        | j                  t              5  t        t        t              t
        j                         d d d        y # 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   JxY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   y xY w)Nr  s   asdr   r   )r*   r+   r   r   r   r   CHECK_UNKNOWNCHECK_ID_MAXr,   rH   r]   CHECK_CRC32r\   CHECK_SHA256rE   s    r;   test_init_bad_checkz FileTestCase.test_init_bad_checkj  s   y) 	3WY62	3 y) 	?WY4+=+=>	?y) 	BWY4+<+<q+@A	B z* 	DW]+4??C	Dz* 	EW]+43C3CD	Ez* 	EW]+43C3CD	Ez* 	FW]+43D3DE	Fz* 	GW]+43E3EF	G 	G!	3 	3	? 	?	B 	B	D 	D	E 	E	E 	E	F 	F	G 	Gs_   H
%H((H5)I)I)I#)I())I4H%(H25H?III%(I14I=c                    | j                  t              5  t        t               dd       d d d        | j                  t              5  t        t               dd       d d d        | j                  t              5  t        t               dd       d d d        | j                  t
              5  t        t               dd       d d d        | j                  t
              5  t        t               dd       d d d        | j                  t              5  t        t               dd       d d d        | j                  t              5  t        t        t              d	       d d d        y # 1 sw Y   GxY w# 1 sw Y    xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   y xY w)
Nr  g(\@r   rv      r   irB   r   )r*   r+   r   r   r   OverflowErrorr,   rH   rE   s    r;   test_init_bad_presetz!FileTestCase.test_init_bad_preset~  sa   y) 	2WYD1	2y) 	0WYB/	0y) 	0WYB/	0}- 	0WYB/	0}- 	0WYB/	0y) 	3WYE2	3 z* 	7W]+A6	7 	7	2 	2	0 	0	0 	0	0 	0	0 	0	3 	3	7 	7sS   E2
E?>F2F&F$F0F<2E<?F	FF!$F-0F9<Gc                    | j                  t              5  t        t               ddg       d d d        | j                  t              5  t        t               dddig       d d d        | j                  t              5  t        t               dddig       d d d        | j                  t              5  t        t               dt
        j                  dd	g       d d d        | j                  t              5  t        t               dt
        j                  dd	g       d d d        | j                  t              5  t        t               dt
        j                  dd	g       d d d        y # 1 sw Y   KxY w# 1 sw Y   !xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   y xY w)
Nr  r>   r   r?   r   r    r@   r   rA   )	r*   r+   r   r   r,   r   r.   rC   rD   rE   s    r;   test_init_bad_filter_specz&FileTestCase.test_init_bad_filter_spec  s   y) 	;WYj\:	;z* 	=WYwl^<	=z* 	>WYtUm_=	>z* 	DWY%)%6%6qABD	D z* 	DWY%)%6%6qABD	D z* 	BWY%)__Q?@B	B 	B	; 	;	= 	=	> 	>	D 	D	D 	D	B 	BsG   E7FF9)F?)F))F57FFFF&)F25F>c                     | j                  t              5  t        t               dt        j
                  dt               d d d        y # 1 sw Y   y xY w)Nr     )r   r   r   )r*   r,   r   r   r   r/   r0   rE   s    r;   !test_init_with_preset_and_filtersz.FileTestCase.test_init_with_preset_and_filters  s>    z* 	6WYDOO}6	6 	6 	6s   +A

Ac                    t        t              5 }t        |      }|j                          | j	                  |j
                         |j                          | j	                  |j
                         d d d        t        t        t              5  t        t              }|j                  }|j                          | j                  |j
                         |j                          d d d        y # 1 sw Y   }xY w# 1 sw Y   y xY wrQ   )
r   rH   r   closerR   closedr   r
   _fprV   )r7   srcr  fps       r;   
test_closezFileTestCase.test_close  s    ]# 	)sAGGISZZ(GGISZZ(	) fm, 	 ABGGIOOBII&GGI	 		) 	)	 	s   A"C.AC:.C7:Dc                 "   t        t        t                    }	 | j                  |j                         |j                          | j                  |j                         |j                          | j                  |j                         t        t               d      }	 | j                  |j                         |j                          | j                  |j                         y # |j                          w xY w# |j                          w xY wNr  )r   r   rH   rR   r;  r  r:  rV   r  s     r;   test_closedzFileTestCase.test_closed  s    W]+,	QXX&FFHQXX&GGI!WY$	QXX&GGI! GGI GGIs   AC'  C< 'C9<Dc                    t        t        t                    }	 | j                  t        |j
                         |j                          | j                  t        |j
                         t        t        t              5  t        t              }	 | j                  |j                         |j                  j                                | j                  |j                         t               |j                          	 d d d        | j                  t        |j
                         y # |j                          w xY w# |j                          w xY w# 1 sw Y   TxY wrQ   )r   r   rH   r*   r   filenor:  r,   r   r
   rT   r<  assertIsInstanceintr  s     r;   test_filenozFileTestCase.test_fileno  s    W]+,	2AHH=GGI*ahh/fm, 	 A  QUU\\^<%%ahhj#6		 	*ahh/ GGI 		 	s0    D% >EAD:+E%D7:EEEc                 \   t        t        t                    }	 | j                  |j	                                |j                          | j                  |j	                                |j                          | j                  t        |j                         t        t               d      }	 | j                  |j	                                |j                          | j                  t        |j                         t        t              }d |_        t        |      }	 | j                  |j	                                |j                          | j                  t        |j                         y # |j                          w xY w# |j                          w xY w# |j                          w xY w)Nr  c                       y)NFr"   r"   rK   r;   <lambda>z,FileTestCase.test_seekable.<locals>.<lambda>  s    rK   )
r   r   rH   rV   seekabler  r:  r*   r,   rR   )r7   r  r=  s      r;   test_seekablezFileTestCase.test_seekable  s   W]+,	OOAJJL)FFHOOAJJL)GGI*ajj1WY$	QZZ\*GGI*ajj1m$$SM	QZZ\*GGI*ajj1# GGI GGI GGIs$   AE/ -F F /FFF+c                 N   t        t        t                    }	 | j                  |j	                                |j                          | j                  |j	                                |j                          | j                  t        |j                         t        t               d      }	 | j                  |j	                                |j                          | j                  t        |j                         y # |j                          w xY w# |j                          w xY wrA  )
r   r   rH   rV   readabler  r:  r*   r,   rR   r  s     r;   test_readablezFileTestCase.test_readable  s    W]+,	OOAJJL)FFHOOAJJL)GGI*ajj1WY$	QZZ\*GGI*ajj1 GGI GGI   AC= -D =DD$c                 N   t        t        t                    }	 | j                  |j	                                |j                          | j                  |j	                                |j                          | j                  t        |j                         t        t               d      }	 | j                  |j	                                |j                          | j                  t        |j                         y # |j                          w xY w# |j                          w xY wrA  )
r   r   rH   rR   writabler  r:  r*   r,   rV   r  s     r;   test_writablezFileTestCase.test_writable  s    W]+,	QZZ\*FFHQZZ\*GGI*ajj1WY$	OOAJJL)GGI*ajj1 GGI GGIrP  c                    t        t        t                    5 }| j                  |j	                         t
               | j                  |j	                         d       d d d        t        t        t                    5 }| j                  |j	                         t
               d d d        t        t        t              t        j                        5 }| j                  |j	                         t
               | j                  |j	                         d       d d d        t        t        t              t        j                        5 }| j                  |j	                         t
               | j                  |j	                         d       d d d        t        t        t              t        j                  t              5 }| j                  |j	                         t
               | j                  |j	                         d       d d d        t        t        t              t        j                  t              5 }| j                  |j	                         t
               | j                  |j	                         d       d d d        t        t        t              t        j                  t               5 }| j                  |j	                         t
               | j                  |j	                         d       d d d        t        t        t"              t        j                  t$              5 }| j                  |j	                         t
               | j                  |j	                         d       d d d        y # 1 sw Y   "xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   @xY w# 1 sw Y   xY w# 1 sw Y   y xY w)NrK   r   r'   )r   r   rH   rT   r  rU   rN   r   r1   r2   re   r/   r0   rj   ri   rn   rm   rr   rq   r  s     r;   	test_readzFileTestCase.test_read  s   gm,- 	,QVVXu-QVVXs+	, g./0 	.AQVVXu-	.gm,T^^D 	,QVVXu-QVVXs+	, g./8I8IJ 	,aQVVXu-QVVXs+	, g./!__mE 	,HIQVVXu-QVVXs+	, g./!__mE 	,HIQVVXu-QVVXs+	, g./!__mE 	,HIQVVXu-QVVXs+	, g./!__mE 	,HIQVVXu-QVVXs+	, 	,/	, 	,	. 	.	, 	,	, 	,	, 	,	, 	,	, 	,	, 	,sf   AM>>%NANAN%AN2<AN?6AO0AO>NNN"%N/2N<?O	OO!c                    t        t        t                    5 }| j                  |j	                  d      d       d d d        t        t        t
                    5 }| j                  |j	                  d      d       d d d        t        t        t              t        j                        5 }| j                  |j	                  d      d       d d d        t        t        t
              t        j                        5 }| j                  |j	                  d      d       d d d        y # 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   txY w# 1 sw Y   y xY w)Nr   rK   r   )	r   r   rH   rT   r  rN   r   r1   r2   r  s     r;   test_read_0zFileTestCase.test_read_03  s   gm,- 	-QVVAY,	-g./0 	-AQVVAY,	-gm,T^^D 	-QVVAY,	-g./8I8IJ 	-aQVVAY,	- 	-	- 	-	- 	-	- 	-	- 	-s/   "D*"D6-"E?"E*D36D?EEc                 R   t        t        t                    5 }g }|j                  d      x}r@| j	                  t        |      d       |j                  |       |j                  d      x}r@| j                  dj                  |      t               d d d        y # 1 sw Y   y xY wNrv   rK   )
r   r   rH   r  r   ry   rz   rT   r{   rU   )r7   r  chunksresults       r;   test_read_10zFileTestCase.test_read_10=  s    gm,- 	6FFF2J&&&$$S["5f% FF2J&&& SXXf-u5	6 	6 	6s   AB/%BB&c                 @   t        t        t        dz              5 }| j                  |j	                         t
        dz         d d d        t        t        t        t        z               5 }| j                  |j	                         t
        dz         d d d        t        t        t        dz        t        j                  t              5 }| j                  |j	                         t
        dz         d d d        y # 1 sw Y   xY w# 1 sw Y   vxY w# 1 sw Y   y xY w)Nr   r      r'   )r   r   rH   rT   r  rU   rN   rn   r   r/   rm   r  s     r;   test_read_multistreamz"FileTestCase.test_read_multistreamE  s    gma/01 	2QQVVXuqy1	2gm.>>?@ 	2AQVVXuqy1	2g.23!__mE 	2HIQVVXuqy1	2 	2		2 	2	2 	2	2 	2s#   (C<+(D(D<DDDc                 :   t         j                  }t        t              t         _        	 t	        t        t        dz              5 }| j                  |j                         t        dz         d d d        |t         _        y # 1 sw Y   xY w# |t         _        w xY wNr   )	_compressionBUFFER_SIZEry   rH   r   r   rT   r  rU   )r7   saved_buffer_sizer  s      r;   )test_read_multistream_buffer_size_alignedz6FileTestCase.test_read_multistream_buffer_size_alignedN  sz     )44#&}#5 	9'-1"456 6!  51956 (9L$6 6 (9L$s#   B (B-B B
B Bc                     t        t        t        t        z               5 }| j	                  |j                         t               d d d        y # 1 sw Y   y xY wrQ   r   r   rH   r   rT   r  rU   r  s     r;   test_read_trailing_junkz$FileTestCase.test_read_trailing_junkY  sB    gm.>>?@ 	.AQVVXu-	. 	. 	.s   %AAc                     t        t        t        dz  t        z               5 }| j	                  |j                         t        dz         d d d        y # 1 sw Y   y xY wra  rg  r  s     r;   #test_read_multistream_trailing_junkz0FileTestCase.test_read_multistream_trailing_junk]  sK    gma/2BBCD 	2QVVXuqy1	2 	2 	2s   (AAc                 &   t        t        t              5  t        t              5 }| j	                  |j                         t               | j	                  |j                         d       d d d        d d d        y # 1 sw Y   xY w# 1 sw Y   y xY wr   )r   r
   rH   r   rT   r  rU   r  s     r;   test_read_from_filez FileTestCase.test_read_from_filea  sq    fm, 	0&! 0Q  51  3/0	0 	00 0	0 	0s#   BAA;*B;B	 BBc                    	 t        j                  d      }t	        t         t
              5  t              5 }| j                  |j                         t               | j                  |j                         d       d d d        d d d        y # t        $ r | j                  d       Y w xY w# 1 sw Y   2xY w# 1 sw Y   y xY w)Nascii%Temporary file name needs to be ASCIIrK   )
r
   encodeUnicodeEncodeErrorskipTestr   rH   r   rT   r  rU   )r7   bytes_filenamer  s      r;   'test_read_from_file_with_bytes_filenamez4FileTestCase.test_read_from_file_with_bytes_filenameg  s    	C#]]73N fm, 	0.) 0Q  51  3/0	0 	0 " 	CMMAB	C0 0	0 	0s4   B B9AB-<B9B*)B*-B6	2B99Cc                     t        t        t        d d             5 }| j                  t        |j
                         d d d        y # 1 sw Y   y xY w)Nr   )r   r   rH   r*   r6   r  r  s     r;   test_read_incompletez!FileTestCase.test_read_incompleteq  sA    gmDS123 	0qh/	0 	0 	0s   !AAc                 Z   t         d d }t        t        |            5 }| j                  t        |j
                         d d d        t        t        |            5 }| j                  |j                  t        t                    t               | j                  t        |j
                  d       d d d        t        d      D ]C  }t        t        |d |             5 }| j                  t        |j
                  d       d d d        E y # 1 sw Y   xY w# 1 sw Y   gxY w# 1 sw Y   hxY w)Nir      )
rH   r   r   r*   r6   r  rT   ry   rU   rx   )r7   	truncatedr  r}   s       r;   test_read_truncatedz FileTestCase.test_read_truncatedu  s     "$3'	gi() 	0Qh/	0gi() 	3QQVVCJ/7h2	3 r 	7A')BQ-01 7Q!!(AFFA67 7	7	0 	0	3 	3
7 7s$   !D	AD"D!	DD!D*	c                    t        t        t                    }|j                          | j	                  t
        |j                         t        t               d      5 }| j	                  t
        |j                         d d d        t        t        t                    5 }| j	                  t        |j                  t                      d d d        y # 1 sw Y   TxY w# 1 sw Y   y xY wrA  )	r   r   rH   r:  r*   r,   r  r+   floatr  s     r;   test_read_bad_argszFileTestCase.test_read_bad_args  s    W]+,		*aff-gi% 	2j!&&1	2gm,- 	:i9	: 	:	2 	2	: 	:s   !C*CCC&c                     t        t        t                    5 }| j                  t        |j
                         d d d        y # 1 sw Y   y xY wrQ   )r   r   r   r*   r   r  r  s     r;   test_read_bad_datazFileTestCase.test_read_bad_data  s;    g./0 	1Ai0	1 	1 	1s   !AAc                 X   t        t        t                    5 }g }|j                         x}r$|j	                  |       |j                         x}r$| j                  dj                  |      t               | j                  |j                         d       d d d        y # 1 sw Y   y xY wr   r   r   rH   read1rz   rT   r{   rU   r7   r  blocksr[  s       r;   
test_read1zFileTestCase.test_read1  s    gm,- 	-FGGI%&%f% GGI%&%SXXf-u5QWWY,	- 	- 	-s   8B AB  B)c                     t        t        t                    5 }| j                  |j	                  d      d       d d d        y # 1 sw Y   y xY w)Nr   rK   )r   r   rH   rT   r  r  s     r;   test_read1_0zFileTestCase.test_read1_0  s>    gm,- 	.QWWQZ-	. 	. 	.s   "AAc                 \   t        t        t                    5 }g }|j                  d      x}r%|j	                  |       |j                  d      x}r%| j                  dj                  |      t               | j                  |j                         d       d d d        y # 1 sw Y   y xY wrY  r  r  s       r;   test_read1_10zFileTestCase.test_read1_10  s    gm,- 	-FGGBK'&'f% GGBK'&'SXXf-u5QWWY,	- 	- 	-s   :B"AB""B+c                 d   t        t        t        dz              5 }g }|j                         x}r$|j	                  |       |j                         x}r$| j                  dj                  |      t        dz         | j                  |j                         d       d d d        y # 1 sw Y   y xY w)Nr   rK   r  r  s       r;   test_read1_multistreamz#FileTestCase.test_read1_multistream  s    gma/01 	-QFGGI%&%f% GGI%&%SXXf-uqy9QWWY,	- 	- 	-s   8B&AB&&B/c                    t        t        t                    }|j                          | j	                  t
        |j                         t        t               d      5 }| j	                  t
        |j                         d d d        t        t        t                    5 }| j	                  t        |j                  d        d d d        y # 1 sw Y   LxY w# 1 sw Y   y xY wrA  )r   r   rH   r:  r*   r,   r  r+   r  s     r;   test_read1_bad_argsz FileTestCase.test_read1_bad_args  s    W]+,		*agg.gi% 	3j!''2	3gm,- 	8i$7	8 	8	3 	3	8 	8s   !C	"C	CCc                    t        t        t                    5 }|j                         }| j	                  t        |      d       | j                  t        j                  |             | j                  |j                         t               d d d        t        t        t                    5 }|j                  d      }| j	                  t        |      d       | j                  t        j                  |             | j                  |j                         t               d d d        y # 1 sw Y   xY w# 1 sw Y   y xY w)Nr   rv   )r   r   rH   peekassertGreaterry   rV   rU   
startswithrT   r  )r7   r  r[  s      r;   	test_peekzFileTestCase.test_peek  s    gm,- 	.VVXFs6{A.OOE,,V45QVVXu-		.
 gm,- 	.VVBZFs6{A.OOE,,V45QVVXu-		. 	.	. 	.
	. 	.s   A4D+-A5D7+D47E c                     t        t               d      5 }| j                  t        |j                         d d d        y # 1 sw Y   y xY wrA  )r   r   r*   r,   r  r  s     r;   test_peek_bad_argszFileTestCase.test_peek_bad_args  s9    gi% 	2j!&&1	2 	2 	2s	   !?Ac                    t        t              5 }|j                         }d d d        t        t        t                    5 }| j                  t        t        |                   d d d        t        t        t                    5 }| j                  t        t        |                   d d d        t        t        t              t        j                        5 }| j                  t        t        |                   d d d        t        t        t              t        j                        5 }| j                  t        t        |                   d d d        t        t        t              t        j                  t              5 }| j                  t        t        |                   d d d        y # 1 sw Y   xY w# 1 sw Y   axY w# 1 sw Y   )xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   y xY wr   )r   rU   	readlinesr   rH   assertListEquallistiterrN   r   r1   r2   rj   r/   ri   r7   r  liness      r;   test_iteratorzFileTestCase.test_iterator  sz   U^ 	"qKKME	"gm,- 	7  d1g6	7g./0 	7A  d1g6	7gm,T^^D 	7  d1g6	7g./8I8IJ 	7a  d1g6	7g./!__mE 	7HI  d1g6	7 	7	" 	"	7 	7	7 	7	7 	7	7 	7	7 	7sG   F8%G%G%G0%G+
%G78GGGG(+G47H c                    t        t              5 }|j                         }d d d        t        t        t                    5 }D ]"  }| j                  |j                         |       $ 	 d d d        y # 1 sw Y   SxY w# 1 sw Y   y xY wrQ   )r   rU   r  r   rH   rT   readline)r7   r  r  lines       r;   test_readlinezFileTestCase.test_readline  sy    U^ 	"qKKME	"gm,- 	5 5  t45	5 	5	" 	"	5 	5s   A3(A?3A<?Bc                    t        t              5 }|j                         }d d d        t        t        t                    5 }| j                  |j                                d d d        y # 1 sw Y   KxY w# 1 sw Y   y xY wrQ   )r   rU   r  r   rH   r  r  s      r;   test_readlineszFileTestCase.test_readlines  sj    U^ 	"qKKME	"gm,- 	7  6	7 	7	" 	"	7 	7s   A+!A7+A47B c                    	 t         j                  dt        d      z  d      }| j                  t	        |      t
        j                         t        t        |            }| j                  |j                  d      d       dt        z   }| j                  |j                  j                  j                         |d       y )N    g    >Ar7  r   r   z)Excessive amount of data was decompressed)r   r3   rF  
assertLessry   rb  rc  r   r   rT   r  r   r   _bufferrawtell)r7   bombdecomp
max_decomps       r;   test_decompress_limitedz$FileTestCase.test_decompress_limited  s    ;}}USX-a}8D	<#;#;<'$-(Q/,,
V^^//446
7	9rK   c                 R   t               5 }t        |d      5 }|j                  t               d d d        t        j                  t              }| j                  |j                         |       d d d        t               5 }t        |dt        j                        5 }|j                  t               d d d        t        j                  t        t        j                        }| j                  |j                         |       d d d        t               5 }t        |dt        j                        5 }|j                  t               d d d        t        j                  t        t        j                        }| j                  |j                         |       d d d        t               5 }t        |dt        j                  t              5 }|j                  t               d d d        t        j                  t        t        j                  t              }| j                  |j                         |       d d d        y # 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   hxY w# 1 sw Y   0xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   y xY w)Nr  r   r'   )r   r   r  rU   r   r3   rT   getvaluer1   r2   r/   ri   )r7   dstr  expecteds       r;   
test_writezFileTestCase.test_write  s   Y 	7##s# q}}U+HS\\^X6		7
 Y 	7##s4>>: a}}U4>>}BHS\\^X6		7
 Y 	7##s4+<+<= }}U43D3D}EHS\\^X6		7
 Y 	7##s4??"/1 45 }}U4??-: % <HS\\^X6	7 	7 	7 	7 	7 	7 	7 	7 	7 	7s   IIAII+I4AI+J4I8
AJ-"JJ%AJI		III(	#I++I58J	=JJJ	JJ&c           	      l   t               5 }t        |d      5 }t        dt        t              d      D ]  }|j                  t        ||dz            	 d d d        t        j                  t              }| j                  |j                         |       d d d        y # 1 sw Y   KxY w# 1 sw Y   y xY w)Nr  r   rv   )
r   r   rx   ry   rU   r  r   r3   rT   r  )r7   r  r  startr  s        r;   test_write_10zFileTestCase.test_write_10  s    Y 	7##s# 3q"1c%j"5 3EGGE%b1233 }}U+HS\\^X6	7 	73 3	7 	7s#   B*;BAB*B'	#B**B3c                    t         d d }t         dd }t         dd  }dj                  d |||fD              }t               5 }t        |d      5 }|j	                  |       d d d        t        |d      5 }|j	                  |       d d d        t        |d      5 }|j	                  |       d d d        | j                  |j                         |       d d d        y # 1 sw Y   ~xY w# 1 sw Y   dxY w# 1 sw Y   JxY w# 1 sw Y   y xY w)NrM      rK   c              3   F   K   | ]  }t         j                  |        y wrQ   r   r3   .0r  s     r;   	<genexpr>z1FileTestCase.test_write_append.<locals>.<genexpr>       LDMM!,L   !r  r  )rU   r{   r   r   r  rT   r  )r7   part1part2part3r  r  r  s          r;   test_write_appendzFileTestCase.test_write_append  s    etd4 de88LueU6KLLY 	7##s# q#s# q#s# qS\\^X6	7 	7   	7 	7sT   DC D4C)DC5,(DC&	"D)C2	.D5C>	:DD
c                 |   	 t        t        d      5 }|j                  t               d d d        t        j                  t              }t        t        d      5 }| j                  |j                         |       d d d        t        t               y # 1 sw Y   kxY w# 1 sw Y   %xY w# t        t               w xY w)Nr  r  )
r   r
   r  rU   r   r3   r  rT   r  r   )r7   r  r  s      r;   test_write_to_filezFileTestCase.test_write_to_file  s    	&#& !}}U+Hfd# 5q  845 6N 5 5 6Ns9   B* B1B* !B:B* BB* B'#B* *B;c                    	 t        j                  d      }	 t	        d      5 }|j                  t               d d d        t        j                  t              }t        t         d      5 }| j                  |j                         |       d d d        t        t                y # t        $ r | j                  d       Y w xY w# 1 sw Y   xY w# 1 sw Y   ExY w# t        t                w xY w)Nrn  ro  r  r  )r
   rp  rq  rr  r   r  rU   r   r3   r  rT   r  r   )r7   rs  r  r  s       r;   &test_write_to_file_with_bytes_filenamez3FileTestCase.test_write_to_file_with_bytes_filename$  s    	C#]]73N	.#. !}}U+Hfd# 5q  845 6N " 	CMMAB	C 5 5 6NsJ   B$ C C1C +!CC $C CC	C CC C-c                    t         d d }t         dd }t         dd  }dj                  d |||fD              }	 t        t        d      5 }|j	                  |       d d d        t        t        d      5 }|j	                  |       d d d        t        t        d      5 }|j	                  |       d d d        t        t        d      5 }| j                  |j                         |       d d d        t        t               y # 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   jxY w# 1 sw Y   =xY w# t        t               w xY w)NrM   r  rK   c              3   F   K   | ]  }t         j                  |        y wrQ   r  r  s     r;   r  z9FileTestCase.test_write_append_to_file.<locals>.<genexpr>6  r  r  r  r  r  )	rU   r{   r   r
   r  r  rT   r  r   )r7   r  r  r  r  r  s         r;   test_write_append_to_filez&FileTestCase.test_write_append_to_file2  s   etd4 de88LueU6KLL
	&#& !&#& !&#& !fd# 5q  845 6N   5 5 6Nsk   D/ C?D/ 2DD/ D.D/ !D#'D/ ?DD/ DD/ D D/ #D,(D/ /E c                 D   t        t               d      }|j                          | j                  t        |j
                  d       t        t        t              d      5 }| j                  t        |j
                  d       d d d        t        t               d      5 }| j                  t        |j
                  d        | j                  t        |j
                  d       | j                  t        |j
                  d       d d d        y # 1 sw Y   xY w# 1 sw Y   y xY w)Nr  r(   r  r)   texti  )r   r   r:  r*   r,   r  rH   r+   r  s     r;   test_write_bad_argsz FileTestCase.test_write_bad_argsC  s    WY$		*aggv6gm,c2 	;aj!''6:	;gi% 	7i$7i&9i#6	7 	7	; 	;	7 	7s   "D
A$D
DDc                    t        t              5 }|j                         }d d d        t               5 }t        |d      5 }|j	                         d d d        t
        j                  t              }| j                  |j                         |       d d d        y # 1 sw Y   |xY w# 1 sw Y   WxY w# 1 sw Y   y xY wrA  )	r   rU   r  r   
writelinesr   r3   rT   r  )r7   r  r  r  r  s        r;   test_writelineszFileTestCase.test_writelinesN  s    U^ 	"qKKME	"Y 	7##s# $qU#$}}U+HS\\^X6		7 	7	" 	"$ $	7 	7s/   BB4 B(AB4B%(B1	-B44B=c                     t        t        t                    5 }|j                  d       | j	                  |j                         t        dd         d d d        y # 1 sw Y   y xY w)Ni+  r   r   rH   seekrT   r  rU   r  s     r;   test_seek_forwardzFileTestCase.test_seek_forwardW  sM    gm,- 	4FF3KQVVXuST{3	4 	4 	4s   9AA$c                     t        t        t        dz              5 }|j                  t	        t
              dz          | j                  |j                         t
        dd         d d d        y # 1 sw Y   y xY w)Nr   {   )r   r   rH   r  ry   rU   rT   r  r  s     r;    test_seek_forward_across_streamsz-FileTestCase.test_seek_forward_across_streams\  s\    gma/01 	4QFF3u:#$QVVXuST{3	4 	4 	4s   A	A..A7c                     t        t        t                    5 }|j                  d       |j	                  dd       | j                  |j                         t        dd         d d d        y # 1 sw Y   y xY w)Nr   i  r   i8  r   r   rH   r  r  rT   rU   r  s     r;   %test_seek_forward_relative_to_currentz2FileTestCase.test_seek_forward_relative_to_currenta  sZ    gm,- 	5FF3KFF4OQVVXuTU|4	5 	5 	5s   AA--A6c                     t        t        t                    5 }|j                  dd       | j	                  |j                         t        dd         d d d        y # 1 sw Y   y xY w)Nir   r  r  s     r;   !test_seek_forward_relative_to_endz.FileTestCase.test_seek_forward_relative_to_endg  O    gm,- 	5FF4OQVVXuTU|4	5 	5 	5   :AA%c                     t        t        t                    5 }|j                  d       |j	                  d       | j                  |j                         t        dd         d d d        y # 1 sw Y   y xY w)Ni     r  r  s     r;   test_seek_backwardzFileTestCase.test_seek_backwardl  sX    gm,- 	4FF4LFF3KQVVXuST{3	4 	4 	4s   A
A,,A5c                 $   t        t        t        dz              5 }|j                  t	        t
              dz          |j                  d       | j                  |j                         t
        dd  t
        z          d d d        y # 1 sw Y   y xY w)Nr   iM  i  )r   r   rH   r  ry   rU   r  rT   r  s     r;   !test_seek_backward_across_streamsz.FileTestCase.test_seek_backward_across_streamsr  sl    gma/01 	<QFF3u:#$FF3KQVVXuST{U':;	< 	< 	<s   A!BBc                     t        t        t                    5 }|j                  dd       | j	                  |j                         t        dd         d d d        y # 1 sw Y   y xY w)Nijr   r  r  s     r;   "test_seek_backward_relative_to_endz/FileTestCase.test_seek_backward_relative_to_endx  r  r  c                 :   t        t        t                    5 }|j                  t	        t
              dz          | j                  |j                         t	        t
                     | j                  |j                         d       d d d        y # 1 sw Y   y xY w)N)#  rK   )	r   r   rH   r  ry   rU   rT   r  r  r  s     r;   test_seek_past_endzFileTestCase.test_seek_past_end}  sk    gm,- 	,FF3u:$%QVVXs5z2QVVXs+	, 	, 	,s   A/BBc                    t        t        t                    5 }|j                  d       | j	                  |j                         d       | j	                  |j                         t               d d d        y # 1 sw Y   y xY w)Nir   )r   r   rH   r  rT   r  r  rU   r  s     r;   test_seek_past_startz!FileTestCase.test_seek_past_start  s]    gm,- 	.FF3KQVVXq)QVVXu-	. 	. 	.s   AA88Bc                    t        t        t                    }|j                          | j	                  t
        |j                  d       t        t               d      5 }| j	                  t
        |j                  d       d d d        t        t        t                    5 }| j	                  t
        |j                  dd       | j	                  t        t
        f|j                  dd       | j	                  t        |j                  d        | j	                  t        |j                  d       d d d        y # 1 sw Y   xY w# 1 sw Y   y xY w)Nr   r  r   	   r"   s   derp)r   r   rH   r:  r*   r,   r  r+   r  s     r;   test_seek_bad_argszFileTestCase.test_seek_bad_args  s    W]+,		*affa0gi% 	5j!&&!4	5gm,- 	:j!&&!Q7y*5qvvq"Ei6i9	: 	:	5 	5	: 	:s   "D6 BE6D?Ec                    t        t        t                    5 }d}	 | j                  |j	                         |       |j                  d      }|sn|t        |      z  }C| j                  |j	                         t        t                     d d d        t        t               d      5 }t        dt        t              d      D ]=  }| j                  |j	                         |       |j                  t        ||dz           ? | j                  |j	                         t        t                     d d d        y # 1 sw Y   xY w# 1 sw Y   y xY w)Nr      r     )
r   r   rH   rT   r  r  ry   rU   rx   r  )r7   r  posr[  s       r;   	test_tellzFileTestCase.test_tell  s   gm,- 	3C  3/s6{"  QVVXs5z2	3 gi% 	3QE
C0 ,  3/c#c'*+, QVVXs5z2		3 	3	3 	3	3 	3s   A4D:)BE:EEc                     t        t        t                    }|j                          | j	                  t
        |j                         y rQ   )r   r   rH   r:  r*   r,   r  r  s     r;   test_tell_bad_argszFileTestCase.test_tell_bad_args  s.    W]+,		*aff-rK   c                    t               }|j                  t        d      }| j                  t	        |      d       | j                  |j                         t               }|j                  t        d      }| j                  |j                         | j                  |j                         |j                  d      }| j                  t	        |      d       | j                  |j                         | j                  ||z   |       y )Nr   r   ih3  i]3  rK      )	r   r5   ISSUE_21872_DATrT   ry   rV   rS   rR   r   )r7   d1entired2out1out2s         r;   test_issue21872zFileTestCase.test_issue21872  s     2>Ve,
 
 }}_}?(  }}S!TB'f-rK   c                 8   t        j                   dg d      }t        |      |j                  z  }t        t	               d      5 }| j                  |j                  |      |       | j                  |j                         |       d d d        y # 1 sw Y   y xY w)NQ)r   r   r   r^  r   r  )arrayry   itemsizer   r   rT   r  r  )r7   qLENGTHr  s       r;   test_issue44439zFileTestCase.test_issue44439  su    KK_-Q!**$gi% 	/QWWQZ0QVVXv.	/ 	/ 	/s   ABBN)Ar   r   r   r  r  r  r  r!  r)  r/  r3  r5  r8  r?  rB  rG  rL  rO  rS  rU  rW  r\  r_  re  rh  rj  rl  rt  rv  rz  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  r  r  r  r  r  r  r"   rK   r;   r
  r
    s:   630G(7"B"6
(""0 242"2",:-62	9.20007:1-.--8
.2757	97077"	774
4
55
4<5
,.:3 .
.</rK   r
  c                   H    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zy)OpenTestCasec                    t         j                  t        t              d      5 }| j	                  |j                         t               d d d        t               5 }t         j                  |d      5 }|j                  t               d d d        t         j                  |j                               }| j	                  |t               t         j                  |d      5 }|j                  t               d d d        t         j                  |j                               }| j	                  |t        dz         d d d        y # 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   fxY w# 1 sw Y   y xY w)Nr  r   r  r   )
r   r  r   rH   rT   r  rU   r  r5   r  )r7   r  bio	file_datas       r;   test_binary_modeszOpenTestCase.test_binary_modes  s   YYw}-t4 	.QVVXu-	.Y 	3#3% 7IY.3% 7IY	2	3 	3	. 	.  	3 	3sI   %EE&2EAE&E5AE&EE	E&E#	E&&E/c                 p   t         j                  d      }|j                  dt        j                        }t
        j                  t        t              dd      5 }| j                  |j                         |       d d d        t               5 }t
        j                  |dd      5 }|j                  |       d d d        t
        j                  |j                               j                  d      }| j                  ||       t
        j                  |dd      5 }|j                  |       d d d        t
        j                  |j                               j                  d      }| j                  ||dz         d d d        y # 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   rxY w# 1 sw Y   y xY w)Nrn  
r&  encodingr'  atr   )rU   decodereplaceoslinesepr   r  r   rH   rT   r  r  r5   r  )r7   uncompresseduncompressed_rawr  r  r  s         r;   test_text_modeszOpenTestCase.test_text_modes  s[   ||G,'//bjjAYYw}-tgYF 	5!QVVX|4	5Y 	>#3w7 &1%&7>>wGIY(893w7 &1%&7>>wGIY(81(<=	> 	>	5 	5& && &	> 	>sJ   !FF,'F9A$F,F /AF,FF	F, F)	%F,,F5c                 l   t        t              5  t        j                  t        d      5 }|j	                  t
               d d d        t        t        d      5 }t        j                  |j                               }| j                  |t
               d d d        t        j                  t        d      5 }| j                  |j                         t
               d d d        t        j                  t        d      5 }|j	                  t
               d d d        t        j                  t        d      5 }| j                  |j                         t
        dz         d d d        d d d        y # 1 sw Y   .xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   CxY w# 1 sw Y   y xY w)Nr   r  r  r   )	r   r
   r   r  r  rU   r5   r  rT   )r7   r  r  s      r;   test_filenamezOpenTestCase.test_filename  sE   f 	664( Afd# 3q OOAFFH5	  E23 64( 2A  51264( A64( 6A  51956	6 	6 3 32 2 6 6	6 	6s   F*E-F*:E:"F*5%F"F*<F"F*4(FF*-E7	2F*:F	?F*F	F*F	F*F'	#F**F3c                 H   t        j                  t              }t        |      5  t        j                  |d      5 }|j                  t               d d d        t        |d      5 }t        j                  |j                               }| j                  |t               d d d        t        j                  |d      5 }| j                  |j                         t               d d d        d d d        y # 1 sw Y   xY w# 1 sw Y   axY w# 1 sw Y   *xY w# 1 sw Y   y xY w)Nr   r  )r  r  r
   r   r   r  r  rU   r5   r  rT   )r7   r   r  r  s       r;   test_with_pathlike_filenamez(OpenTestCase.test_with_pathlike_filename  s    <<'h 	28T* ah% 3 OOAFFH5	  E23 8T* 2a  512	2 	2 3 32 2	2 	2sR   DC4D&:D  D>%D#D4C=	9D D		DD	DD!c                    | j                  t              5  t        j                  t        d       d d d        | j                  t              5  t        j                  t        d       d d d        | j                  t              5  t        j                  t        dd       d d d        | j                  t              5  t        j                  t        dd       d d d        | j                  t              5  t        j                  t        dd	       d d d        y # 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   hxY w# 1 sw Y   y xY w)
Nr   rbtr  zutf-8r  ignore)errorsr
  )newline)r*   r,   r   r  r
   rE   s    r;   test_bad_paramszOpenTestCase.test_bad_params	  s   z* 	"IIfb!	"z* 	%IIfe$	%z* 	6IIfdWI5	6z* 	5IIfd8I4	5z* 	2IIfdDI1	2 	2	" 	"	% 	%	6 	6	5 	5	2 	2s;   D D,D8 E:E D),D58EEEc                     t         j                  t        d}t        j                  t	        t
              dfi |5 }| j                  |j                         t               d d d        t	               5 }t        j                  |dfi |5 }|j                  t               d d d        t        j                  |j                         fi |}| j                  |t               d d d        y # 1 sw Y   xY w# 1 sw Y   XxY w# 1 sw Y   y xY w)Nr'   r  r   )r   r/   r0   r  r   re   rT   r  rU   r  r5   r  )r7   optionsr  r  r  s        r;   test_format_and_filtersz$OpenTestCase.test_format_and_filters  s    !__GYYw/0$B'B 	.aQVVXu-	.Y 	/#300 AB'BIY.		/ 	/	. 	. 	/ 	/s0   %C,3DC8!AD,C58D	=DDc                 l   t         j                  d      }|j                  dt        j                        }t               5 }t        j                  |dd      5 }|j                  |       d d d        t        j                  |j                               j                  d      }| j                  ||       |j                  d       t        j                  |dd      5 }| j                  |j                         |       d d d        d d d        y # 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   y xY w)Nrn  r
  r'  z	utf-16-ler  r   r&  )rU   r  r  r  r  r   r   r  r  r5   r  rT   r  r  )r7   r  r  r  r  r  s         r;   test_encodingzOpenTestCase.test_encoding!  s    ||G,'//bjjAY 	9#3{; &q%&7>>{KIY(89HHQK3{; 9q  <89	9 	9& &
9 9	9 	9s=    D*D+A5D* !DD*D	D*D'	#D**D3c                    t        t        j                  d            5 }t        j                  |ddd      5 }| j	                  |j                         d       d d d        d d d        y # 1 sw Y   xY w# 1 sw Y   y xY w)Ns   foobarr&  rn  r  )r  r  foobar)r   r   r3   r  rT   r  )r7   r  r  s      r;   test_encoding_error_handlerz(OpenTestCase.test_encoding_error_handler.  sp    T]]=12 	5c3wxH 5A  845	5 	55 5	5 	5s"   A7!A+A7+A4	0A77B c                    t         j                  d      }t               5 }t        j	                  |ddd      5 }|j                  |       d d d        |j                  d       t        j	                  |ddd      5 }| j                  |j                         |g       d d d        d d d        y # 1 sw Y   fxY w# 1 sw Y   xY w# 1 sw Y   y xY w)Nrn  r'  r
  )r  r  r   r&  )	rU   r  r   r   r  r  r  rT   r  )r7   r  r  r  s       r;   test_newlinezOpenTestCase.test_newline4  s    ||G$Y 	8#3wE HHQK3wE 8  78		8 	8 8 8		8 	8s:   C	B12C	>"B= C	1B:	6C	=C	C		Cc                    | j                  t        t               dD ]  }t        t               d|v rdnd }t        j	                  t        ||      5  	 d d d        | j                  t              5  t        j	                  t        |      5  	 d d d        d d d         y # 1 sw Y   NxY w# 1 sw Y    xY w# 1 sw Y   xY w)N)r  r  r#  trn  r  )r  r   r
   r   r  r*   r  )r7   r   r  s      r;   test_x_modezOpenTestCase.test_x_mode>  s    '% 	D6N"%+w4H64(; ""?3 YYvt,  	   s0   B"2B:B.B:"B+	.B73B::C	N)r   r   r   r  r  r  r  r  r!  r#  r&  r)  r,  r"   rK   r;   r  r    s4    3>6	22	/958	rK   r  c                   $    e Zd Zd Zd Zd Zd Zy)MiscellaneousTestCasec                    | j                  t        j                  t        j                               | j                  t        j                  t        j                               | j                  t        j                  t        j                  dz                | j                  t        j                  t        j                               y r   )rV   r   is_check_supportedr]   r-  rR   r,  r+  rE   s    r;   test_is_check_supportedz-MiscellaneousTestCase.test_is_check_supportedL  s     	//@A//0@0@AB 	001B1BQ1FGH 	001C1CDErK   c                    | j                  t              5  t        j                  d       d d d        | j                  t              5  t        j                  ddi       d d d        | j                  t              5  t        j                  t        j
                  dd       d d d        | j                  t        j                        5  t        j                  t        j                  dd       d d d        t        j                  t        j                  dd	d
dd      }| j                  |d       y # 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   jxY w)Ns
   not a dictr       rx  )r    junkr  r    distr   r   r      )r    pblplc	dict_size   ]   )
r*   r+   r   _encode_filter_propertiesr,   r.   r   rC   FILTER_LZMA1rT   )r7   propss     r;   test__encode_filter_propertiesz4MiscellaneousTestCase.test__encode_filter_propertiesX  s,   y) 	:**=9	:z* 	:**D%=9	:z* 	R**$2C2CR+PQ	Rt~~. 	:**$2C2C37,9 :	:
 ..''$0  	 45%	: 	:	: 	:	R 	R	: 	:s/   D7	E>'E'E7EEEE%c                    | j                  t              5  t        j                  t        j                  dt
        i       d d d        | j                  t        j                        5  t        j                  t        j                  d       d d d        t        j                  t        j                  d      }| j                  |d   t        j                         | j                  |d   d       | j                  |d   d       | j                  |d	   d
       | j                  |d   d       y # 1 sw Y   xY w# 1 sw Y   xY w)Nz	should bes   too longr<  r    r8  r   r9  r   r:  r   r;  r7  )
r*   r+   r   _decode_filter_propertiesrD   r   r   rC   r>  rT   )r7   
filterspecs     r;   test__decode_filter_propertiesz4MiscellaneousTestCase.test__decode_filter_propertiesm  s   y) 	R**4??[%<PQ	Rt~~. 	K**4+<+<kJ	K 33!!#79
D)4+<+<=D)1-D)1-D)1-K0':	R 	R	K 	Ks   +D1(%D=1D:=Ec                     t         j                  t         j                  d      }t         j                  |      }t         j                  t         j                  |      }| j	                  ||       y )Nr<  )r   rB  r>  r=  rT   )r7   spec1	reencodedspec2s       r;    test_filter_properties_roundtripz6MiscellaneousTestCase.test_filter_properties_roundtrip|  sV    ..!!#792259	..t/@/@)L&rK   N)r   r   r   r1  r@  rD  rI  r"   rK   r;   r.  r.  J  s    
F6*;'rK   r.  s  
LAERTES

       O, fear me not.
       I stay too long: but here my father comes.

       Enter POLONIUS

       A double blessing is a double grace,
       Occasion smiles upon a second leave.

LORD POLONIUS

       Yet here, Laertes! aboard, aboard, for shame!
       The wind sits in the shoulder of your sail,
       And you are stay'd for. There; my blessing with thee!
       And these few precepts in thy memory
       See thou character. Give thy thoughts no tongue,
       Nor any unproportioned thought his act.
       Be thou familiar, but by no means vulgar.
       Those friends thou hast, and their adoption tried,
       Grapple them to thy soul with hoops of steel;
       But do not dull thy palm with entertainment
       Of each new-hatch'd, unfledged comrade. Beware
       Of entrance to a quarrel, but being in,
       Bear't that the opposed may beware of thee.
       Give every man thy ear, but few thy voice;
       Take each man's censure, but reserve thy judgment.
       Costly thy habit as thy purse can buy,
       But not express'd in fancy; rich, not gaudy;
       For the apparel oft proclaims the man,
       And they in France of the best rank and station
       Are of a most select and generous chief in that.
       Neither a borrower nor a lender be;
       For loan oft loses both itself and friend,
       And borrowing dulls the edge of husbandry.
       This above all: to thine ownself be true,
       And it must follow, as the night the day,
       Thou canst not then be false to any man.
       Farewell: my blessing season this in thee!

LAERTES

       Most humbly do I take my leave, my lord.

LORD POLONIUS

       The time invites you; go; your servants tend.

LAERTES

       Farewell, Ophelia; and remember well
       What I have said to you.

OPHELIA

       'Tis in my memory lock'd,
       And you yourself shall keep the key of it.

LAERTES

       Farewell.
s   this is not a valid lzma streams   7zXZ  ִF !   t/] bXn䴝o
2h\6(wd"u.n򎍏/=/Mާz-]rZo#z/FMt6 BF$Ql,bnԨNȆ3x2O@Q /OozSt<I#ud6Y]-Pee:	7
pJV%G=?(΂=I3RisPX2jLbc-HoJliQk?@xH12Puw㾪iWЀ#cb5]dWlUGyF7v5h8W5:?rD5@7cԗitSkKvy6Te]:kla4r}r*z8hӼl-KZL3Ϝ!^9w PPKdZ}%$/&,qh{Q)qÀo![Ԋwt`^??\RԎXaЫS>ɕH	%$.oRbU^S/vr̢GkzʀЋIxy-0z^֏_Pi萄ܿky܁+\YYhw̴ |ejz`A叩	=_%voZO	M-<"CMg~b|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"^S6=@,Gr[>n<(}~4stff	/)
ײwQnsƷ(G<6[~H ~:e(_(c̟gvS=S>
YRGAOdcPܟ"[Q~䈡#CϾHؾmWFQ(XDKB.-՞|N]Z=)MLTiN?4O&u70ؓBNEyϘDʚL_]ܩ1 cؿp-N(#2Ilr __main__)7rb  r  ior   r   r   r  r  r   r   r   testr   unittesttest.supportr   r   test.support.import_helperr	   test.support.os_helperr
   r   r   r   r   r   r   TestCaser   r   r   r
  r  r.  rU   r   rH   rN   r.   r0   re   rC   PRESET_DEFAULTPRESET_EXTREMEri   rj   FILTER_IA64rm   rn   rD   rq   rr   r  r   mainr"   rK   r;   <module>rX     s     A A 	    
   ( 4 V F Fk3X%6%6 k3\D+):): D+N u
/8$$ u
/pu8$$ up7'H-- 7'x>	@ 6 +4 `(" X ))Q78* \ ))15)) //$2E2EEGH:& | ((%@))*,) Z ))15>))Qa@B? HA% L zHMMO rK   