a
    ze_                    @   s  d dl Z d dlZd dlmZmZmZ d dlZd dlZd dlZd dl	Z	d dl
Z
d dlmZ d dlZd dlmZmZmZmZmZ edZd dlmZmZmZmZ G dd dejZG d	d
 d
ejZG dd dZG dd dejZG dd dejZG dd dejZdZ dZ!dZ"dZ#ej$ddgZ%dZ&ej'ddej$ej(ej)B dgZ*dZ+ej,dddej$igZ-d Z.ej'd!dej/d"dej$d!dd#gZ0d$Z1d%Z2e3d&kre4  dS )'    N)BytesIOUnsupportedOperationDEFAULT_BUFFER_SIZE)support)_4GTESTFNimport_module
bigmemtestunlinklzma)LZMACompressorLZMADecompressor	LZMAErrorLZMAFilec                   @   s@  e Zd Zdd Zdd Zdd Zdd ZdGd
dZdd Zdd Z	dd Z
dd Zdd Zdd Zdd Zdd Zdd Zdd Zd d! Zd"d# Zd$d% Zd&d' Zd(d) Zd*d+ Zd,d- Zd.d/ Zd0d1 Zd2d3 Zd4d5 Zd6d7 Zd8d9 Zej e!e"d: d;d<d=d> Z#ej e!e"d: d?d<d@dA Z$dBdC Z%ej&dDdE Z'dFS )HCompressorDecompressorTestCasec                 C   sR  |  ttg  | j ttdd | j ttdd | j ttdd | j ttdd | j tttjd |  t$ td	d
tjigd W d    n1 s0    Y  |  ttd | j ttdd |  t ttjdd W d    n1 s0    Y  |  t ttjdd W d    n1 s$0    Y  | j ttt	d |  t ttj
t	d W d    n1 sn0    Y  |  t ttjt	d W d    n1 s0    Y  t }|  t|j |  t|jdd |  t|jd | }|  t|jd |  t|j t }|  t|j |  t|jdd || |  t|jd d S )Ng@format checkZasdfpreset   filters   idr   r    s   qwmemlimitZzzz   r   r      foo   bars   blahs   quux)assertRaises	TypeErrorr   
ValueErrorr   FORMAT_AUTOFILTER_LZMA2r   
FORMAT_RAWFILTERS_RAW_1	FORMAT_XZFORMAT_ALONEcompressflush
decompressEOFError)selflzcemptylzdr   r   $/usr/lib/python3.9/test/test_lzma.pytest_simple_bad_args   s>    2,...
z3CompressorDecompressorTestCase.test_simple_bad_argsc                 C   s   | j ttdgd | j ttddigd | j ttddigd |  t$ ttjddgd W d    n1 sr0    Y  |  t$ ttjddgd W d    n1 s0    Y  |  t$ ttjddgd W d    n1 s0    Y  d S )	N   wobsiter   xyzzyr   r   ́ r   r   foo)r%   r&   r   r'   r   r)   FILTER_DELTA
FILTER_X86r2   r   r   r6   test_bad_filter_spec@   s    22z3CompressorDecompressorTestCase.test_bad_filter_specc                 C   s$   t  }|t | t|jd d S )Ns   nyan)r   r0   COMPRESSED_XZr%   r1   r2   r5   r   r   r6   test_decompressor_after_eofK   s    
z:CompressorDecompressorTestCase.test_decompressor_after_eofc                 C   sZ   t dd}| t|jt t tjdd}| t|jt t tjdd}| t|jt d S )N   r   )	r   r%   r   r0   rA   r   r,   r-   COMPRESSED_ALONErB   r   r   r6   test_decompressor_memlimitP   s    
z9CompressorDecompressorTestCase.test_decompressor_memlimit    c                 C   sN   |  |j ||}| |t | |j| | |j | |j| d S N)assertFalseeofr0   assertEqualINPUTr   
assertTrueunused_data)r2   r5   datar   rN   outr   r   r6   _test_decompressor\   s    
z1CompressorDecompressorTestCase._test_decompressorc                 C   s0   t  }| |ttj t  }| |ttj d S rH   )r   rQ   rA   r   CHECK_CRC64rE   
CHECK_NONErB   r   r   r6   test_decompressor_autod   s    z5CompressorDecompressorTestCase.test_decompressor_autoc                 C   s   t tj}| |ttj d S rH   )r   r   r,   rQ   rA   rR   rB   r   r   r6   test_decompressor_xzk   s    
z3CompressorDecompressorTestCase.test_decompressor_xzc                 C   s   t tj}| |ttj d S rH   )r   r   r-   rQ   rE   rS   rB   r   r   r6   test_decompressor_aloneo   s    
z6CompressorDecompressorTestCase.test_decompressor_alonec                 C   s"   t tjtd}| |ttj d S Nr   )r   r   r*   r+   rQ   COMPRESSED_RAW_1rS   rB   r   r   r6   test_decompressor_raw_1s   s    z6CompressorDecompressorTestCase.test_decompressor_raw_1c                 C   s"   t tjtd}| |ttj d S rW   )r   r   r*   FILTERS_RAW_2rQ   COMPRESSED_RAW_2rS   rB   r   r   r6   test_decompressor_raw_2w   s    z6CompressorDecompressorTestCase.test_decompressor_raw_2c                 C   s"   t tjtd}| |ttj d S rW   )r   r   r*   FILTERS_RAW_3rQ   COMPRESSED_RAW_3rS   rB   r   r   r6   test_decompressor_raw_3{   s    z6CompressorDecompressorTestCase.test_decompressor_raw_3c                 C   s"   t tjtd}| |ttj d S rW   )r   r   r*   FILTERS_RAW_4rQ   COMPRESSED_RAW_4rS   rB   r   r   r6   test_decompressor_raw_4   s    z6CompressorDecompressorTestCase.test_decompressor_raw_4c              	   C   s   t  }g }tdttdD ],}| |j ||t||d   qd|}| 	|t
 | 	|jtj | |j | 	|jd d S Nr   
   rG   r   rangelenrA   rI   rJ   appendr0   joinrK   rL   r   r   rR   rM   rN   r2   r5   rP   ir   r   r6   test_decompressor_chunks   s    
z7CompressorDecompressorTestCase.test_decompressor_chunksc              	   C   s   t  }g }tdttdD ]\}| |j ||d ||d ||d ||t||d   qd|}| 	|t
 | 	|jtj | |j | 	|jd d S rc   re   rj   r   r   r6   test_decompressor_chunks_empty   s    
z=CompressorDecompressorTestCase.test_decompressor_chunks_emptyc                 C   s"  t  }d}g }ttd }||jtd | |d | |j | t|d | ||jd|d | |j | t|d | ||jt|d  |d | t|d | |j	s||jd|d | t|d | qd
|}| |t | |jtj | |jd d S )Nd      
max_lengthrG   )r   rg   rA   rh   r0   rI   needs_inputrK   assertLessEqualrJ   ri   rL   r   r   rR   rN   )r2   r5   rq   rP   Zlen_r   r   r6    test_decompressor_chunks_maxsize   s.    
z?CompressorDecompressorTestCase.test_decompressor_chunks_maxsizec                 C   s   t  }g }| |jtd d ddd ||dd ||tdd d ||tdd   | d|t d S )Nrn   r   rp   rG   ro   i      r   rK   r0   rA   rh   ri   rL   r2   r5   rP   r   r   r6   test_decompressor_inputbuf_1   s    z;CompressorDecompressorTestCase.test_decompressor_inputbuf_1c                 C   s   t  }g }| |jtd d ddd ||d ||tdd d ||tdd d ||tdd   | d|t d S )N   r   rp   rG   i  ro   ,  rx   ry   r   r   r6   test_decompressor_inputbuf_2   s    z;CompressorDecompressorTestCase.test_decompressor_inputbuf_2c                 C   sl   t  }g }||td d d ||tdd d ||tdd   | d|t d S )Nr{      r|   rG   )r   rh   r0   rA   rK   ri   rL   ry   r   r   r6   test_decompressor_inputbuf_3   s    z;CompressorDecompressorTestCase.test_decompressor_inputbuf_3c                 C   s&   t  }d}| j|t| tj|d d S )Ns	   fooblibarrN   )r   rQ   rA   r   rR   )r2   r5   extrar   r   r6   test_decompressor_unused_data   s
    z<CompressorDecompressorTestCase.test_decompressor_unused_datac                 C   sl   t  }| t|jt t tj}| t|jt t tj}| t|jt	 t tj
td}| t|jt	 d S rW   )r   r%   r   r0   rX   r   r,   rE   r-   rA   r*   r+   rB   r   r   r6   test_decompressor_bad_input   s    

z:CompressorDecompressorTestCase.test_decompressor_bad_inputc                 C   s*   t  }| t|jt | t|jt d S rH   )r   r%   r   r0   rX   rB   r   r   r6   test_decompressor_bug_28275  s    z:CompressorDecompressorTestCase.test_decompressor_bug_28275c                 C   s2   t  }|t|  }t }| ||tj d S rH   )r   r.   rL   r/   r   rQ   r   rR   r2   r3   cdatar5   r   r   r6   test_roundtrip_xz  s    z0CompressorDecompressorTestCase.test_roundtrip_xzc                 C   s6   t tj}|t|  }t }| ||tj d S rH   )	r   r   r-   r.   rL   r/   r   rQ   rS   r   r   r   r6   test_roundtrip_alone  s    
z3CompressorDecompressorTestCase.test_roundtrip_alonec                 C   sB   t tjtd}|t|  }ttjtd}| ||tj	 d S rW   
r   r   r*   r`   r.   rL   r/   r   rQ   rS   r   r   r   r6   test_roundtrip_raw!  s    z1CompressorDecompressorTestCase.test_roundtrip_rawc                 C   sp   t tjtd}|t}||d7 }||d7 }||d7 }|| 7 }ttjtd}| ||tj	 d S )Nr   rG   r   r   r   r   r6   test_roundtrip_raw_empty'  s    
z7CompressorDecompressorTestCase.test_roundtrip_raw_emptyc              	   C   sn   t  }g }tdttdD ] }||t||d   q||  d|}t }| 	||t
j d S rc   r   rf   rg   rL   rh   r.   r/   ri   r   rQ   r   rR   r2   r3   r   rk   r5   r   r   r6   test_roundtrip_chunks1  s    
z4CompressorDecompressorTestCase.test_roundtrip_chunksc              	   C   s   t  }g }tdttdD ]P}||t||d   ||d ||d ||d q||  d|}t }| 	||t
j d S rc   r   r   r   r   r6   test_roundtrip_empty_chunks;  s    
z:CompressorDecompressorTestCase.test_roundtrip_empty_chunksc                 C   s"   t  }| j|tt tjtd d S )Nr   )r   rQ   rA   rE   r   rR   rB   r   r   r6   test_decompressor_multistreamJ  s    z<CompressorDecompressorTestCase.test_decompressor_multistreamrn   ro   )sizeZmemusec                 C   s`   t  }|d| |  }t|}z.| t|| | t|dd W d }nd }0 d S )N   xr   )r   r.   r/   r   r0   rK   rg   strip)r2   r   r3   r   ddatar   r   r6   test_compressor_bigmemQ  s    
z5CompressorDecompressorTestCase.test_compressor_bigmemr   c                 C   sh   t  }d}t|}z@||| d  }t|}||}| || W d  } }}nd  } }}0 d S )Ni      )r   random	randbytesr   r.   r0   rK   )r2   r   r5   	blocksizeblockinputr   r   r   r   r6   test_decompressor_bigmem]  s    


z7CompressorDecompressorTestCase.test_decompressor_bigmemc              	   C   s   t tjd D ]t}| t tt | W d    n1 s@0    Y  | t tt | W d    q1 sx0    Y  qd S Nr   )rf   pickleHIGHEST_PROTOCOLr%   r&   dumpsr   r   )r2   protor   r   r6   test_picklem  s
    ,z*CompressorDecompressorTestCase.test_picklec                 C   sH   t td}t }| }tdD ]}|  q | j| | ddd d S )Ngettotalrefcountrn   r   rd   )Zdelta)r   Zget_attributesysr   rf   __init__ZassertAlmostEqual)r2   r   r5   Zrefs_beforerk   r   r   r6   &test_refleaks_in_decompressor___init__t  s    
zECompressorDecompressorTestCase.test_refleaks_in_decompressor___init__N)rG   )(__name__
__module____qualname__r7   r@   rC   rF   rQ   rT   rU   rV   rY   r\   r_   rb   rl   rm   ru   rz   r}   r   r   r   r   r   r   r   r   r   r   r   r   Zskip_if_pgo_taskr	   r   r   r   r   Zrefcount_testr   r   r   r   r6   r      sJ   (
 	


r   c                   @   sT   e Zd Zdd Zdd Zdd Zdd Zd	d
 Zdd Zdd Z	dd Z
dd ZdS )"CompressDecompressFunctionTestCasec                 C   s,  |  ttj |  ttjg  | j ttjddd | j ttjddd | j ttjddd | j ttjddd	 |  t( tjdd
dtjigd W d    n1 s0    Y  |  ttj |  ttjg  | j ttjddd | j ttjddd |  t" tjdtji d W d    n1 s*0    Y  |  t" tjdtjdd W d    n1 sh0    Y  |  t tjdtd	 W d    n1 s0    Y  |  t" tjdtj	td W d    n1 s0    Y  |  t" tjdtj
td W d    n1 s0    Y  d S )NrG   xzr   Znoner   Zblahr   rD   r   r   r   r   r   g   1Ar   r"   r!   r   r    )r%   r&   r   r.   r'   r)   r0   r*   r+   r,   r-   r?   r   r   r6   test_bad_args  s0    622.2z0CompressDecompressFunctionTestCase.test_bad_argsc                 C   s   |  t tjtdd W d    n1 s.0    Y  |  t" tjttjdd W d    n1 sj0    Y  |  t" tjttjdd W d    n1 s0    Y  d S )NrD   r   r   )r%   r   r   r0   rA   r,   rE   r-   r?   r   r   r6   test_decompress_memlimit  s    ,$z;CompressDecompressFunctionTestCase.test_decompress_memlimitc                 C   s   t t}| |t t t}| |t t tt j}| |t t tt j}| |t t jtt j	t
d}| |t t jtt j	td}| |t t jtt j	td}| |t t jtt j	td}| |t d S rW   )r   r0   rA   rK   rL   rE   r,   r-   rX   r*   r+   r[   rZ   r^   r]   ra   r`   r2   r   r   r   r6   test_decompress_good_input  s0    

z=CompressDecompressFunctionTestCase.test_decompress_good_inputc                 C   s   |  ttjtd d  |  ttjtd d  | j ttjtd d tjtd | j ttjt	d d tjt
d | j ttjtd d tjtd | j ttjtd d tjtd d S )N   r"   )r%   r   r   r0   rA   rE   rX   r*   r+   r[   rZ   r^   r]   ra   r`   r?   r   r   r6    test_decompress_incomplete_input  s    zCCompressDecompressFunctionTestCase.test_decompress_incomplete_inputc                 C   s  |  t tt W d    n1 s*0    Y  |  t tt W d    n1 s^0    Y  |  t  tjttjd W d    n1 s0    Y  |  t  tjttj	d W d    n1 s0    Y  |  t" tjttj
td W d    n1 s0    Y  d S Nr   r"   )r%   r   r   r0   COMPRESSED_BOGUSrX   rE   r,   rA   r-   r*   r+   r?   r   r   r6   test_decompress_bad_input  s    ((..
z<CompressDecompressFunctionTestCase.test_decompress_bad_inputc                 C   s   t t}t |}| |t t tt j}t |}| |t t tt j}t |}| |t t jtt jtd}t j|t jtd}| |t d S rW   )	r   r.   rL   r0   rK   r,   r-   r*   r`   )r2   r   r   r   r   r6   test_roundtrip  s    



z1CompressDecompressFunctionTestCase.test_roundtripc                 C   s"   t tt }| |td  d S )Nro   )r   r0   rA   rE   rK   rL   r   r   r   r6   test_decompress_multistream  s    z>CompressDecompressFunctionTestCase.test_decompress_multistreamc                 C   s   t tt }| |t d S rH   r   r0   rA   r   rK   rL   r   r   r   r6   test_decompress_trailing_junk  s    z@CompressDecompressFunctionTestCase.test_decompress_trailing_junkc                 C   s&   t td t }| |td  d S )Nr   r   r   r   r   r6   )test_decompress_multistream_trailing_junk   s    zLCompressDecompressFunctionTestCase.test_decompress_multistream_trailing_junkN)r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r6   r   ~  s   r   c                   @   s*   e Zd ZdZd
ddZdd Zdd Zd	S )TempFilez=Context manager - creates a file, and deletes it on __exit__.rG   c                 C   s   || _ || _d S rH   )filenamerO   )r2   r   rO   r   r   r6   r     s    zTempFile.__init__c                 C   s<   t | jd}|| j W d    n1 s.0    Y  d S )Nwb)openr   writerO   r2   fr   r   r6   	__enter__  s    zTempFile.__enter__c                 G   s   t | j d S rH   )r
   r   )r2   argsr   r   r6   __exit__  s    zTempFile.__exit__N)rG   )r   r   r   __doc__r   r   r   r   r   r   r6   r     s   
r   c                   @   s  e Zd Zdd Zdd Zdd Zdd Zd	d
 Zdd Zdd Z	dd Z
dd Zdd Zdd Zdd Zdd Zdd Zdd Zdd  Zd!d" Zd#d$ Zd%d& Zd'd( Zd)d* Zd+d, Zd-d. Zd/d0 Zd1d2 Zd3d4 Zd5d6 Zd7d8 Zd9d: Zd;d< Z d=d> Z!d?d@ Z"dAdB Z#dCdD Z$dEdF Z%dGdH Z&dIdJ Z'dKdL Z(dMdN Z)dOdP Z*dQdR Z+dSdT Z,dUdV Z-dWdX Z.dYdZ Z/d[d\ Z0d]d^ Z1d_d` Z2dadb Z3dcdd Z4dedf Z5dgdh Z6didj Z7dkdl Z8dmdn Z9dodp Z:dqdr Z;dsdt Z<dudv Z=dwdx Z>dydz Z?d{d| Z@d}S )~FileTestCasec                 C   s   t tt}W d    n1 s"0    Y  t t d}W d    n1 sN0    Y  t t d}W d    n1 sz0    Y  t t d}W d    n1 s0    Y  d S )Nwxa)r   r   rA   r   r   r   r6   	test_init  s    zFileTestCase.test_initc              	   C   s   t t}t|t t| }| | t W d    n1 sD0    Y  t|d}|	t W d    n1 sx0    Y  t|$}| | td  W d    n1 s0    Y  W d    n1 s0    Y  d S )Nr   ro   )
pathlibPathr   r   rA   r   rK   readrL   r   )r2   r   r   r   r   r6    test_init_with_PathLike_filename   s    

.(
z-FileTestCase.test_init_with_PathLike_filenamec              	   C   s   t tt tt}W d    n1 s*0    Y  ttd}W d    n1 sT0    Y  ttd}W d    n1 s~0    Y  W d    n1 s0    Y  d S )Nr   r   )r   r   rA   r   r   r   r   r6   test_init_with_filename*  s    
z$FileTestCase.test_init_with_filenamec              	   C   s,  t t ttd W d    n1 s,0    Y  ttd W d    n1 sV0    Y  ttd W d    n1 s0    Y  ttd W d    n1 s0    Y  ttd W d    n1 s0    Y  ttd W d    n1 s0    Y  W d    n1 s0    Y  d S )Nrrbr   r   r   ab)r   r   r   r?   r   r   r6   test_init_mode3  s    zFileTestCase.test_init_modec              
   C   s   |  tt dD ]}tt tt| W d    n1 s<0    Y  | t: tt| W d    n1 sr0    Y  W d    q1 s0    Y  qd S )N)r   xb)
addCleanupr
   r   r   r%   FileExistsErrorr2   moder   r   r6   test_init_with_x_modeB  s    z"FileTestCase.test_init_with_x_modec                 C   sz  |  t tttd W d    n1 s.0    Y  |  t tttd W d    n1 sf0    Y  |  t tttd W d    n1 s0    Y  |  t tttd W d    n1 s0    Y  |  t tttd W d    n1 s0    Y  |  t tttd W d    n1 sJ0    Y  |  t tttd W d    n1 s0    Y  |  t tttd W d    n1 s0    Y  |  t tttd	 W d    n1 s0    Y  |  t tttd
 W d    n1 s20    Y  |  t tttd W d    n1 sl0    Y  d S )N)r   r   r   xtzx+rxZwxrtzr+wtzw+rw)r%   r'   r   r   rA   r?   r   r   r6   test_init_bad_modeL  s,    ,,,,......zFileTestCase.test_init_bad_modec                 C   s  |  t  tt ddd W d    n1 s00    Y  |  t" tt dtjd W d    n1 sl0    Y  |  t& tt dtjd d W d    n1 s0    Y  |  t" ttt	tj
d W d    n1 s0    Y  |  t" ttt	tjd W d    n1 s&0    Y  |  t" ttt	tjd W d    n1 sd0    Y  |  t" ttt	tjd W d    n1 s0    Y  |  t" ttt	tjd W d    n1 s0    Y  d S )Nr   s   asdr   r   )r%   r&   r   r   r   r   CHECK_UNKNOWNCHECK_ID_MAXr'   rA   rS   CHECK_CRC32rR   CHECK_SHA256r?   r   r   r6   test_init_bad_checkd  s     .040222z FileTestCase.test_init_bad_checkc                 C   s  |  t  tt ddd W d    n1 s00    Y  |  t  tt ddd W d    n1 sj0    Y  |  t  tt ddd W d    n1 s0    Y  |  t  tt ddd W d    n1 s0    Y  |  t  tt ddd W d    n1 s0    Y  |  t  tt ddd W d    n1 sV0    Y  |  t  tttd	d W d    n1 s0    Y  d S )
Nr   g(\@r   rd      rr   ir<   r   )r%   r&   r   r   r   OverflowErrorr'   rA   r?   r   r   r6   test_init_bad_presetx  s    ....00z!FileTestCase.test_init_bad_presetc                 C   s  |  t" tt ddgd W d    n1 s20    Y  |  t& tt dddigd W d    n1 sr0    Y  |  t& tt dddigd W d    n1 s0    Y  |  t* tt dtjdd	gd W d    n1 s0    Y  |  t* tt dtjdd	gd W d    n1 s<0    Y  |  t* tt dtjdd	gd W d    n1 s0    Y  d S )
Nr   r8   r   r9   r   r   r:   r   r;   )	r%   r&   r   r   r'   r   r)   r=   r>   r?   r   r   r6   test_init_bad_filter_spec  s$    044$&z&FileTestCase.test_init_bad_filter_specc                 C   sD   |  t& tt dtjdtd W d    n1 s60    Y  d S )Nr      )r   r   r   )r%   r'   r   r   r   r*   r+   r?   r   r   r6   !test_init_with_preset_and_filters  s    z.FileTestCase.test_init_with_preset_and_filtersc                 C   s   t t@}t|}|  | |j |  | |j W d    n1 sN0    Y  ttt: tt}|j}|  | 	|j |  W d    n1 s0    Y  d S rH   )
r   rA   r   closerI   closedr   r   _fprM   )r2   srcr   fpr   r   r6   
test_close  s    
*zFileTestCase.test_closec                 C   s   t tt}z,| |j |  | |j W |  n
|  0 | |j t t d}z| |j W |  n
|  0 | |j d S Nr   )r   r   rA   rI   r   r   r   rM   r   r   r   r6   test_closed  s    zFileTestCase.test_closedc              	   C   s   t tt}z| t|j W |  n
|  0 | t|j tt	tV t t	}z2| 
| |j  | | t W |  n
|  0 W d    n1 s0    Y  | t|j d S rH   )r   r   rA   r%   r   filenor   r'   r   r   rK   r   ZassertIsInstanceintr   r   r   r6   test_fileno  s    2zFileTestCase.test_filenoc                 C   s   t tt}z0| |  |  | |  W |  n
|  0 | t|j t t d}z| 	|  W |  n
|  0 | t|j tt}dd |_t |}z| 	|  W |  n
|  0 | t|j d S )Nr   c                   S   s   dS )NFr   r   r   r   r6   <lambda>  rG   z,FileTestCase.test_seekable.<locals>.<lambda>)
r   r   rA   rM   seekabler   r   r%   r'   rI   )r2   r   r   r   r   r6   test_seekable  s&    
zFileTestCase.test_seekablec                 C   s   t tt}z0| |  |  | |  W |  n
|  0 | t|j t t d}z| 	|  W |  n
|  0 | t|j d S r   )
r   r   rA   rM   readabler   r   r%   r'   rI   r   r   r   r6   test_readable  s    zFileTestCase.test_readablec                 C   s   t tt}z0| |  |  | |  W |  n
|  0 | t|j t t d}z| 	|  W |  n
|  0 | t|j d S r   )
r   r   rA   rI   writabler   r   r%   r'   rM   r   r   r   r6   test_writable  s    zFileTestCase.test_writablec                 C   s  t tt0}| | t | | d W d    n1 sB0    Y  t tt }| | t W d    n1 s~0    Y  t tttjd0}| | t | | d W d    n1 s0    Y  t tttj	d0}| | t | | d W d    n1 s$0    Y  t tt
tjtd0}| | t | | d W d    n1 sz0    Y  t tttjtd0}| | t | | d W d    n1 s0    Y  t tttjtd0}| | t | | d W d    n1 s&0    Y  t tttjtd0}| | t | | d W d    n1 s|0    Y  d S )NrG   r   r"   )r   r   rA   rK   r   rL   rE   r   r,   r-   rX   r*   r+   r[   rZ   r^   r]   ra   r`   r   r   r   r6   	test_read  sF    ...0000zFileTestCase.test_readc                 C   s  t tt"}| |dd W d    n1 s40    Y  t tt"}| |dd W d    n1 sr0    Y  t tttjd"}| |dd W d    n1 s0    Y  t tttjd"}| |dd W d    n1 s0    Y  d S )Nr   rG   r   )	r   r   rA   rK   r   rE   r   r,   r-   r   r   r   r6   test_read_0-  s    000zFileTestCase.test_read_0c                 C   sr   t ttR}g }|d}|s"q>| t|d || q| d|t	 W d    n1 sd0    Y  d S Nrd   rG   )
r   r   rA   r   rt   rg   rh   rK   ri   rL   )r2   r   chunksresultr   r   r6   test_read_107  s    
zFileTestCase.test_read_10c                 C   s   t ttd $}| | td  W d    n1 s:0    Y  t ttt $}| | td  W d    n1 s~0    Y  t ttd tj	t
d$}| | td  W d    n1 s0    Y  d S )Nr~   ro      r"   )r   r   rA   rK   r   rL   rE   r^   r   r*   r]   r   r   r   r6   test_read_multistreamB  s    22z"FileTestCase.test_read_multistreamc                 C   sl   t j}ttt _zNtttd $}| | td  W d    n1 sL0    Y  W |t _n|t _0 d S Nr~   )	_compressionBUFFER_SIZErg   rA   r   r   rK   r   rL   )r2   Zsaved_buffer_sizer   r   r   r6   )test_read_multistream_buffer_size_alignedK  s    
4z6FileTestCase.test_read_multistream_buffer_size_alignedc                 C   sD   t ttt  }| | t W d    n1 s60    Y  d S rH   r   r   rA   r   rK   r   rL   r   r   r   r6   test_read_trailing_junkV  s    z$FileTestCase.test_read_trailing_junkc                 C   sL   t ttd t $}| | td  W d    n1 s>0    Y  d S r  r	  r   r   r   r6   #test_read_multistream_trailing_junkZ  s    z0FileTestCase.test_read_multistream_trailing_junkc              	   C   sv   t ttX tt0}| | t | | d W d    n1 sJ0    Y  W d    n1 sh0    Y  d S NrG   )r   r   rA   r   rK   r   rL   r   r   r   r6   test_read_from_file^  s    
z FileTestCase.test_read_from_filec              	   C   s   zt d}W n ty*   | d Y n0 tt tX t|0}| | t	 | | d W d    n1 sv0    Y  W d    n1 s0    Y  d S )Nascii%Temporary file name needs to be ASCIIrG   )
r   encodeUnicodeEncodeErrorskipTestr   rA   r   rK   r   rL   )r2   bytes_filenamer   r   r   r6   'test_read_from_file_with_bytes_filenamed  s    
z4FileTestCase.test_read_from_file_with_bytes_filenamec                 C   sF   t ttd d }| t|j W d    n1 s80    Y  d S )Nr   )r   r   rA   r%   r1   r   r   r   r   r6   test_read_incompleten  s    z!FileTestCase.test_read_incompletec              	   C   s   t d d }tt|}| t|j W d    n1 s<0    Y  tt|6}| |ttt | t|jd W d    n1 s0    Y  t	dD ]H}tt|d |  }| t|jd W d    q1 s0    Y  qd S )Nir      )
rA   r   r   r%   r1   r   rK   rg   rL   rf   )r2   Z	truncatedr   rk   r   r   r6   test_read_truncatedr  s    ,.z FileTestCase.test_read_truncatedc                 C   s   t tt}|  | t|j t t d}| t|j W d    n1 sR0    Y  t tt"}| t|jt  W d    n1 s0    Y  d S r   )	r   r   rA   r   r%   r'   r   r&   floatr   r   r   r6   test_read_bad_args  s    ,zFileTestCase.test_read_bad_argsc                 C   s>   t tt}| t|j W d    n1 s00    Y  d S rH   )r   r   r   r%   r   r   r   r   r   r6   test_read_bad_data  s    zFileTestCase.test_read_bad_datac                 C   sp   t ttP}g }| }|s q,|| q| d|t | | d W d    n1 sb0    Y  d S r  r   r   rA   read1rh   rK   ri   rL   r2   r   Zblocksr  r   r   r6   
test_read1  s    zFileTestCase.test_read1c                 C   sB   t tt"}| |dd W d    n1 s40    Y  d S )Nr   rG   )r   r   rA   rK   r  r   r   r   r6   test_read1_0  s    zFileTestCase.test_read1_0c                 C   sr   t ttR}g }|d}|s"q.|| q| d|t | | d W d    n1 sd0    Y  d S r   r  r  r   r   r6   test_read1_10  s    
zFileTestCase.test_read1_10c                 C   sx   t ttd T}g }| }|s$q0|| q| d|td  | | d W d    n1 sj0    Y  d S )Nr~   rG   r  r  r   r   r6   test_read1_multistream  s    z#FileTestCase.test_read1_multistreamc                 C   s   t tt}|  | t|j t t d}| t|j W d    n1 sR0    Y  t tt }| t|jd  W d    n1 s0    Y  d S r   )r   r   rA   r   r%   r'   r  r&   r   r   r   r6   test_read1_bad_args  s    ,z FileTestCase.test_read1_bad_argsc                 C   s   t ttH}| }| t|d | t| | 	|
 t W d    n1 sZ0    Y  t ttJ}|d}| t|d | t| | 	|
 t W d    n1 s0    Y  d S )Nr   rd   )r   r   rA   peekZassertGreaterrg   rM   rL   
startswithrK   r   )r2   r   r  r   r   r6   	test_peek  s    .
zFileTestCase.test_peekc                 C   s>   t t d}| t|j W d    n1 s00    Y  d S r   )r   r   r%   r'   r#  r   r   r   r6   test_peek_bad_args  s    zFileTestCase.test_peek_bad_argsc                 C   s  t t}| }W d    n1 s&0    Y  tt t$}| tt|| W d    n1 sf0    Y  tt t$}| tt|| W d    n1 s0    Y  tt tt	j
d$}| tt|| W d    n1 s0    Y  tt tt	jd$}| tt|| W d    n1 s40    Y  tt tt	jtd$}| tt|| W d    n1 s~0    Y  d S r   )r   rL   	readlinesr   rA   assertListEquallistiterrE   r   r,   r-   r[   r*   rZ   r2   r   linesr   r   r6   test_iterator  s    
&2224zFileTestCase.test_iteratorc                 C   sz   t t}| }W d    n1 s&0    Y  tt t*}|D ]}| | | qBW d    n1 sl0    Y  d S rH   )r   rL   r'  r   rA   rK   readline)r2   r   r,  liner   r   r6   test_readline  s
    
&zFileTestCase.test_readlinec                 C   sp   t t}| }W d    n1 s&0    Y  tt t }| | | W d    n1 sb0    Y  d S rH   )r   rL   r'  r   rA   r(  r+  r   r   r6   test_readlines  s    
&zFileTestCase.test_readlinesc                 C   sh   t jdtd dd}| t|tj tt|}| 	|
dd dt }| |jj |d dS )z-Decompressed data buffering should be limited    g    >Ar   r   r   z)Excessive amount of data was decompressedN)r   r.   r   Z
assertLessrg   r  r  r   r   rK   r   r   rt   _bufferrawtell)r2   ZbombdecompZ
max_decompr   r   r6   test_decompress_limited  s    z$FileTestCase.test_decompress_limitedc              	   C   s  t  ^}t|d}|t W d    n1 s20    Y  tt}| | | W d    n1 sj0    Y  t  j}t|dtjd}|t W d    n1 s0    Y  tjttjd}| | | W d    n1 s0    Y  t  l}t|dtj	d}|t W d    n1 s.0    Y  tjttj	d}| | | W d    n1 sn0    Y  t  p}t|dtj
td}|t W d    n1 s0    Y  tjttj
td}| | | W d    n1 s0    Y  d S )Nr   r   r"   )r   r   r   rL   r   r.   rK   getvaluer,   r-   r*   rZ   )r2   dstr   expectedr   r   r6   
test_write  s2    (
.(.*0
*
zFileTestCase.test_writec              	   C   s   t  }t|d<}tdttdD ]}|t||d   q$W d    n1 sT0    Y  tt}| |	 | W d    n1 s0    Y  d S )Nr   r   rd   )
r   r   rf   rg   rL   r   r   r.   rK   r8  )r2   r9  r   startr:  r   r   r6   test_write_10
  s    6
zFileTestCase.test_write_10c              	   C   s  t d d }t dd }t dd  }ddd |||fD }t }t|d}|| W d    n1 sp0    Y  t|d}|| W d    n1 s0    Y  t|d}|| W d    n1 s0    Y  | | | W d    n1 s0    Y  d S )NrD      rG   c                 s   s   | ]}t |V  qd S rH   r   r.   .0r   r   r   r6   	<genexpr>  rG   z1FileTestCase.test_write_append.<locals>.<genexpr>r   r   )rL   ri   r   r   r   rK   r8  )r2   part1part2part3r:  r9  r   r   r   r6   test_write_append  s    (((zFileTestCase.test_write_appendc                 C   s   zt td}|t W d    n1 s,0    Y  tt}ttd }| | | W d    n1 sp0    Y  W t	t n
t	t 0 d S )Nr   r   )
r   r   r   rL   r   r.   r   rK   r   r
   )r2   r   r:  r   r   r6   test_write_to_file   s    (
0zFileTestCase.test_write_to_filec                 C   s   zt d}W n ty*   | d Y n0 zt|d}|t W d    n1 sX0    Y  tt}t	t d }| 
| | W d    n1 s0    Y  W tt  n
tt  0 d S )Nr  r  r   r   )r   r  r  r  r   r   rL   r   r.   r   rK   r   r
   )r2   r  r   r:  r   r   r6   &test_write_to_file_with_bytes_filename*  s    (
0z3FileTestCase.test_write_to_file_with_bytes_filenamec                 C   s2  t d d }t dd }t dd  }ddd |||fD }zttd}|| W d    n1 sj0    Y  ttd}|| W d    n1 s0    Y  ttd}|| W d    n1 s0    Y  ttd }| | | W d    n1 s0    Y  W tt n
tt 0 d S )	NrD   r>  rG   c                 s   s   | ]}t |V  qd S rH   r?  r@  r   r   r6   rB  <  rG   z9FileTestCase.test_write_append_to_file.<locals>.<genexpr>r   r   r   )	rL   ri   r   r   r   r   rK   r   r
   )r2   rC  rD  rE  r:  r   r   r   r6   test_write_append_to_file8  s    (((2z&FileTestCase.test_write_append_to_filec                 C   s   t t d}|  | t|jd t ttd }| t|jd W d    n1 sX0    Y  t t d@}| t|jd  | t|jd | t|jd W d    n1 s0    Y  d S )Nr   r#   r   r$   texti  )r   r   r   r%   r'   r   rA   r&   r   r   r   r6   test_write_bad_argsI  s    .z FileTestCase.test_write_bad_argsc              	   C   s   t t}| }W d    n1 s&0    Y  t  ^}t|d}|| W d    n1 sb0    Y  tt}| | | W d    n1 s0    Y  d S r   )	r   rL   r'  r   
writelinesr   r.   rK   r8  )r2   r   r,  r9  r:  r   r   r6   test_writelinesT  s    
&(
zFileTestCase.test_writelinesc                 C   sR   t tt2}|d | | tdd   W d    n1 sD0    Y  d S )Ni+  r   r   rA   seekrK   r   rL   r   r   r   r6   test_seek_forward]  s    
zFileTestCase.test_seek_forwardc                 C   s^   t ttd :}|ttd  | | tdd   W d    n1 sP0    Y  d S )Nro   {   )r   r   rA   rO  rg   rL   rK   r   r   r   r   r6    test_seek_forward_across_streamsb  s    z-FileTestCase.test_seek_forward_across_streamsc                 C   s^   t tt>}|d |dd | | tdd   W d    n1 sP0    Y  d S )Nrn   i  r   i8  r   r   rA   r   rO  rK   rL   r   r   r   r6   %test_seek_forward_relative_to_currentg  s    
z2FileTestCase.test_seek_forward_relative_to_currentc                 C   sT   t tt4}|dd | | tdd   W d    n1 sF0    Y  d S )Niro   rN  r   r   r   r6   !test_seek_forward_relative_to_endm  s    z.FileTestCase.test_seek_forward_relative_to_endc                 C   s\   t tt<}|d |d | | tdd   W d    n1 sN0    Y  d S )Ni     rS  r   r   r   r6   test_seek_backwardr  s    

zFileTestCase.test_seek_backwardc                 C   sl   t ttd H}|ttd  |d | | tdd  t  W d    n1 s^0    Y  d S )Nro   iM  i  )r   r   rA   r   rg   rL   rO  rK   r   r   r   r6   !test_seek_backward_across_streamsx  s    
z.FileTestCase.test_seek_backward_across_streamsc                 C   sT   t tt4}|dd | | tdd   W d    n1 sF0    Y  d S )Nijro   rN  r   r   r   r6   "test_seek_backward_relative_to_end~  s    z/FileTestCase.test_seek_backward_relative_to_endc                 C   sf   t ttF}|ttd  | | tt | | d W d    n1 sX0    Y  d S )N)#  rG   )	r   r   rA   rO  rg   rL   rK   r5  r   r   r   r   r6   test_seek_past_end  s    zFileTestCase.test_seek_past_endc                 C   sZ   t tt:}|d | | d | | t W d    n1 sL0    Y  d S )Nir   )r   r   rA   rO  rK   r5  r   rL   r   r   r   r6   test_seek_past_start  s    
z!FileTestCase.test_seek_past_startc                 C   s   t tt}|  | t|jd t t d }| t|jd W d    n1 sV0    Y  t ttX}| t|jdd | ttf|jdd | t|jd  | t|jd W d    n1 s0    Y  d S )Nr   r   r   	   r   s   derp)r   r   rA   r   r%   r'   rO  r&   r   r   r   r6   test_seek_bad_args  s    .zFileTestCase.test_seek_bad_argsc                 C   s   t ttV}d}| | | |d}|s2q@|t|7 }q| | tt W d    n1 sh0    Y  t t d`}tdttdD ]*}| | | |	t||d   q| | tt W d    n1 s0    Y  d S )Nr      r      )
r   r   rA   rK   r5  r   rg   rL   rf   r   )r2   r   posr  r   r   r6   	test_tell  s    
2zFileTestCase.test_tellc                 C   s&   t tt}|  | t|j d S rH   )r   r   rA   r   r%   r'   r5  r   r   r   r6   test_tell_bad_args  s    zFileTestCase.test_tell_bad_argsc                 C   s   t  }|jtdd}| t|d | |j t  }|jtdd}| |j | |j |d}| t|d | |j | || | d S )Nrr   rp   ih3  i]3  rG      )	r   r0   ISSUE_21872_DATrK   rg   rM   rJ   rI   rs   )r2   Zd1ZentireZd2Zout1Zout2r   r   r6   test_issue21872  s    
zFileTestCase.test_issue21872c                 C   sp   t  dg d}t||j }tt d2}| ||| | | | W d    n1 sb0    Y  d S )NQ)r   ro   r   r  r~   r   )arrayrg   itemsizer   r   rK   r   r5  )r2   qZLENGTHr   r   r   r6   test_issue44439  s
    zFileTestCase.test_issue44439N)Ar   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"  r%  r&  r-  r0  r1  r7  r;  r=  rF  rG  rH  rI  rK  rM  rP  rR  rT  rU  rW  rX  rY  r[  r\  r^  rb  rc  rf  rk  r   r   r   r6   r     s|   

	

	
		
	r   c                   @   s\   e Zd Zdd Zdd Zdd Zdd Zd	d
 Zdd Zdd Z	dd Z
dd Zdd ZdS )OpenTestCasec              	   C   s  t ttd }| | t W d    n1 s60    Y  t }t |d}|t W d    n1 st0    Y  t |	 }| |t t |d}|t W d    n1 s0    Y  t |	 }| |td  W d    n1 s0    Y  d S )Nr   r   r   ro   )
r   r   r   rA   rK   r   rL   r   r0   r8  )r2   r   bio	file_datar   r   r6   test_binary_modes  s    .((zOpenTestCase.test_binary_modesc              	   C   s4  t d}|dtj}tttd }| 	|
 | W d    n1 sN0    Y  t }t|d}|| W d    n1 s0    Y  t| d}| 	|| t|d}|| W d    n1 s0    Y  t| d}| 	||d  W d    n1 s&0    Y  d S )Nr  
r   r   Zatro   )rL   decodereplaceoslinesepr   r   r   rA   rK   r   r   r0   r8  )r2   uncompresseduncompressed_rawr   rm  rn  r   r   r6   test_text_modes  s    
.((zOpenTestCase.test_text_modesc              	   C   s^  t t> ttd}|t W d    n1 s80    Y  ttd*}t| }| |t W d    n1 s|0    Y  ttd }| | t W d    n1 s0    Y  ttd}|t W d    n1 s0    Y  ttd$}| | td  W d    n1 s00    Y  W d    n1 sP0    Y  d S )Nr   r   r   ro   )	r   r   r   r   r   rL   r0   r   rK   )r2   r   rn  r   r   r6   test_filename  s    (*.(zOpenTestCase.test_filenamec              	   C   s   t t}t| t|d}|t W d    n1 s@0    Y  t|d*}t|	 }| 
|t W d    n1 s0    Y  t|d }| 
|	 t W d    n1 s0    Y  W d    n1 s0    Y  d S )Nr   r   )r   r   r   r   r   r   r   rL   r0   r   rK   )r2   r   r   rn  r   r   r6   test_with_pathlike_filename  s    

(*z(OpenTestCase.test_with_pathlike_filenamec                 C   s   |  t ttd W d    n1 s,0    Y  |  t ttd W d    n1 sb0    Y  |  t  tjtddd W d    n1 s0    Y  |  t  tjtddd W d    n1 s0    Y  |  t  tjtddd	 W d    n1 s0    Y  d S )
Nr   Zrbtr   zutf-8encodingignore)errorsrp  newline)r%   r'   r   r   r   r?   r   r   r6   test_bad_params  s    **..zOpenTestCase.test_bad_paramsc              	   C   s   t jtd}t jttdfi | }| | t W d    n1 sJ0    Y  t p}t j|dfi |}|	t W d    n1 s0    Y  t j
| fi |}| |t W d    n1 s0    Y  d S )Nr"   r   r   )r   r*   r+   r   r   rX   rK   r   rL   r   r0   r8  )r2   optionsr   rm  rn  r   r   r6   test_format_and_filters  s    .(z$OpenTestCase.test_format_and_filtersc              	   C   s   t d}|dtj}t }tj|ddd}|| W d    n1 sP0    Y  t	|
 d}| || |d tj|ddd }| | | W d    n1 s0    Y  W d    n1 s0    Y  d S )Nr  rp  r   z	utf-16-lerz  r   r   )rL   rq  rr  rs  rt  r   r   r   r   r0   r8  rK   rO  r   )r2   ru  rv  rm  r   rn  r   r   r6   test_encoding'  s    
(
zOpenTestCase.test_encodingc              	   C   st   t tdR}tj|dddd }| | d W d    n1 sH0    Y  W d    n1 sf0    Y  d S )Ns   foobarr   r  r|  )r{  r}  Zfoobar)r   r   r.   r   rK   r   )r2   rm  r   r   r   r6   test_encoding_error_handler4  s    z(OpenTestCase.test_encoding_error_handlerc              	   C   s   t d}t }tj|ddd}|| W d    n1 sB0    Y  |d tj|ddd"}| | |g W d    n1 s0    Y  W d    n1 s0    Y  d S )Nr  r   rp  r~  r   r   )	rL   rq  r   r   r   r   rO  rK   r'  )r2   rJ  rm  r   r   r   r6   test_newline:  s    
(
zOpenTestCase.test_newlinec              
   C   s   |  tt dD ]}tt tt| W d    n1 s>0    Y  | t< tt| W d    n1 sv0    Y  W d    q1 s0    Y  qd S )N)r   r   r   )r   r
   r   r   r   r%   r   r   r   r   r6   test_x_modeD  s    zOpenTestCase.test_x_modeN)r   r   r   ro  rw  rx  ry  r  r  r  r  r  r  r   r   r   r6   rl    s   
rl  c                   @   s,   e Zd Zdd Zdd Zdd Zdd Zd	S )
MiscellaneousTestCasec                 C   sP   |  ttj |  ttj | ttjd  | ttj d S r   )rM   r   is_check_supportedrS   r   rI   r   r   r?   r   r   r6   test_is_check_supportedQ  s    z-MiscellaneousTestCase.test_is_check_supportedc                 C   s  |  t td W d    n1 s*0    Y  |  t tddi W d    n1 sb0    Y  |  t" ttjdd W d    n1 s0    Y  |  tj" ttjdd W d    n1 s0    Y  ttjdd	d
dd}| 	|d d S )Ns
   not a dictr      r  )r   ZjunkrZ  r   distro   r   r      )r   pblplc	dict_size   ]   )
r%   r&   r   _encode_filter_propertiesr'   r)   r   r=   FILTER_LZMA1rK   )r2   Zpropsr   r   r6   test__encode_filter_properties]  s$    (,0&z4MiscellaneousTestCase.test__encode_filter_propertiesc                 C   s   |  t" ttjdti W d    n1 s20    Y  |  tj ttjd W d    n1 sl0    Y  ttjd}| 	|d tj | 	|d d | 	|d d | 	|d	 d
 | 	|d d d S )Nz	should bes   too longr  r   r  ro   r  r   r  r   r  r  )
r%   r&   r   _decode_filter_propertiesr>   bytesr   r=   r  rK   )r2   Z
filterspecr   r   r6   test__decode_filter_propertiesr  s    0,z4MiscellaneousTestCase.test__decode_filter_propertiesc                 C   s6   t t jd}t |}t t j|}| || d S )Nr  )r   r  r  r  rK   )r2   Zspec1Z	reencodedZspec2r   r   r6    test_filter_properties_roundtrip  s    
z6MiscellaneousTestCase.test_filter_properties_roundtripN)r   r   r   r  r  r  r  r   r   r   r6   r  O  s   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

       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4lhnZe,B-c|&LL86bViF̎4/^W?܄(dOD64,SJc^0	D[憰n^븸)a @+/h3`+P-Bn^/w<M!EY<٦Bǃ"D|&d`70o喤v;]'hA&9~@t<4)=:&6A+ <k\dv^l5C?ԠMCȀ3BPjyzE[oT'*HM7f;'wM 帷 D+PgnkcƐVUovfZ3^翬vxJjn*o>_+D{sHAGݭ7q+Wg"X~4`q)KsV5s*;{<@GjLؒ&	u5]\A|ICeQ*~uXyP
fZEu>'`cZ8jUoe>Rb#H-!ޝkw{/K)A:UM̻{9 ((6iu؞q7-BQ8vACd!'ͮؓިb2K l	|DU>w7}W|g|1 m@6+	D Mҵ'~Co	fI1φ`͂wcdCUEMJH=*I"^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__)5r  rh  ior   r   r   rs  r   r   r   r   testr   ZunittestZtest.supportr   r   r   r	   r
   r   r   r   r   r   ZTestCaser   r   r   r   rl  r  rL   r   rA   rE   r)   r+   rX   r=   PRESET_DEFAULTPRESET_EXTREMErZ   r[   FILTER_IA64r]   r^   r>   r`   ra   re  r   mainr   r   r   r6   <module>   st     l      Iw<@0,.

>
-

D 
