B
    u9aL7                @   s  d dl Z d dlmZmZmZ d dlZd dlZd dlZd dlZd dl	Z	d dl
mZ d dlZd dlmZmZmZmZmZmZ 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%d& Z2e3d'kre2  dS )(    N)BytesIOUnsupportedOperationDEFAULT_BUFFER_SIZE)support)_4GTESTFNimport_module
bigmemtestrun_unittestunlinklzma)LZMACompressorLZMADecompressor	LZMAErrorLZMAFilec               @   s4  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 Zee d: d;d<d=d> Z!ee d: d?d<d@dA Z"dBdC Z#e$j%dDdE Z&dFS )HCompressorDecompressorTestCasec          	   C   s  |  ttg  | j ttdd | j ttdd | j ttdd | j ttdd | j tttjd |  t td	d
tjigd W d Q R X |  ttd | j ttdd |  t ttjdd W d Q R X |  t ttjdd W d Q R X | j ttt	d |  t ttj
t	d W d Q R X |  t ttjt	d W d Q R X t }|  t|j |  t|jdd |  t|jd | }|  t|jd |  t|j t }|  t|j |  t|jdd || |  t|jd d S )Ng@)format )checkZasdf)preset   )filters   id)r   r    s   qw)memlimitZzzzi   )r   r   s   foos   bars   blahs   quux)assertRaises	TypeErrorr   
ValueErrorr   ZFORMAT_AUTOFILTER_LZMA2r   
FORMAT_RAWFILTERS_RAW_1	FORMAT_XZFORMAT_ALONEcompressflush
decompressEOFError)selflzcemptylzdr   r   /usr/lib/python3.7/test_lzma.pytest_simple_bad_args   s>    
z3CompressorDecompressorTestCase.test_simple_bad_argsc          	   C   s   | j ttdgd | j ttddigd | j ttddigd |  t ttjddgd W d Q R X |  t ttjddgd W d Q R X |  t ttjddgd W d Q R X d S )	Ns   wobsite)r   xyzzyr   r   í r   )r   foo)r   r   r   r   r   r   FILTER_DELTA
FILTER_X86)r(   r   r   r,   test_bad_filter_spec?   s    z3CompressorDecompressorTestCase.test_bad_filter_specc             C   s$   t  }|t | t|jd d S )Ns   nyan)r   r&   COMPRESSED_XZr   r'   )r(   r+   r   r   r,   test_decompressor_after_eofJ   s    
z:CompressorDecompressorTestCase.test_decompressor_after_eofc             C   sZ   t dd}| t|jt t tjdd}| t|jt t tjdd}| t|jt d S )Ni   )r   )	r   r   r   r&   r3   r   r"   r#   COMPRESSED_ALONE)r(   r+   r   r   r,   test_decompressor_memlimitO   s    
z9CompressorDecompressorTestCase.test_decompressor_memlimit    c             C   sN   |  |j ||}| |t | |j| | |j | |j| d S )N)assertFalseeofr&   assertEqualINPUTr   
assertTrueunused_data)r(   r+   datar   r=   outr   r   r,   _test_decompressor[   s    
z1CompressorDecompressorTestCase._test_decompressorc             C   s0   t  }| |ttj t  }| |ttj d S )N)r   r@   r3   r   CHECK_CRC64r5   
CHECK_NONE)r(   r+   r   r   r,   test_decompressor_autoc   s    z5CompressorDecompressorTestCase.test_decompressor_autoc             C   s   t tj}| |ttj d S )N)r   r   r"   r@   r3   rA   )r(   r+   r   r   r,   test_decompressor_xzj   s    
z3CompressorDecompressorTestCase.test_decompressor_xzc             C   s   t tj}| |ttj d S )N)r   r   r#   r@   r5   rB   )r(   r+   r   r   r,   test_decompressor_alonen   s    
z6CompressorDecompressorTestCase.test_decompressor_alonec             C   s"   t tjtd}| |ttj d S )N)r   )r   r   r    r!   r@   COMPRESSED_RAW_1rB   )r(   r+   r   r   r,   test_decompressor_raw_1r   s    z6CompressorDecompressorTestCase.test_decompressor_raw_1c             C   s"   t tjtd}| |ttj d S )N)r   )r   r   r    FILTERS_RAW_2r@   COMPRESSED_RAW_2rB   )r(   r+   r   r   r,   test_decompressor_raw_2v   s    z6CompressorDecompressorTestCase.test_decompressor_raw_2c             C   s"   t tjtd}| |ttj d S )N)r   )r   r   r    FILTERS_RAW_3r@   COMPRESSED_RAW_3rB   )r(   r+   r   r   r,   test_decompressor_raw_3z   s    z6CompressorDecompressorTestCase.test_decompressor_raw_3c             C   s"   t tjtd}| |ttj d S )N)r   )r   r   r    FILTERS_RAW_4r@   COMPRESSED_RAW_4rB   )r(   r+   r   r   r,   test_decompressor_raw_4~   s    z6CompressorDecompressorTestCase.test_decompressor_raw_4c          	   C   s   t  }g }x@tdttdD ],}| |j ||t||d   qW d|}| 	|t
 | 	|jtj | |j | 	|jd d S )Nr   
   r7   )r   rangelenr3   r8   r9   appendr&   joinr:   r;   r   r   rA   r<   r=   )r(   r+   r?   ir   r   r,   test_decompressor_chunks   s     
z7CompressorDecompressorTestCase.test_decompressor_chunksc          	   C   s   t  }g }xptdttdD ]\}| |j ||d ||d ||d ||t||d   qW d|}| 	|t
 | 	|jtj | |j | 	|jd d S )Nr   rQ   r7   )r   rR   rS   r3   r8   r9   rT   r&   rU   r:   r;   r   r   rA   r<   r=   )r(   r+   r?   rV   r   r   r,   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 | x2|j	s||jd|d | t|d | qW d
|}| |t | |jtj | |jd d S )Nd      )
max_lengthr7   )r   rS   r3   rT   r&   r8   Zneeds_inputr:   assertLessEqualr9   rU   r;   r   r   rA   r=   )r(   r+   r[   r?   Zlen_r   r   r,    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 )NrY   r   )r[   r7   rZ   i      )r   r:   r&   r3   rT   rU   r;   )r(   r+   r?   r   r   r,   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   )r[   r7   i  rZ   i,  )r   r:   r&   r3   rT   rU   r;   )r(   r+   r?   r   r   r,   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 )Nrb      i,  r7   )r   rT   r&   r3   r:   rU   r;   )r(   r+   r?   r   r   r,   test_decompressor_inputbuf_3   s    z;CompressorDecompressorTestCase.test_decompressor_inputbuf_3c             C   s&   t  }d}| j|t| tj|d d S )Ns	   fooblibar)r=   )r   r@   r3   r   rA   )r(   r+   Zextrar   r   r,   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 )N)r   )r   r   r   r&   rF   r   r"   r5   r#   r3   r    r!   )r(   r+   r   r   r,   test_decompressor_bad_input   s    

z:CompressorDecompressorTestCase.test_decompressor_bad_inputc             C   s*   t  }| t|jt | t|jt d S )N)r   r   r   r&   rF   )r(   r+   r   r   r,   test_decompressor_bug_28275  s    z:CompressorDecompressorTestCase.test_decompressor_bug_28275c             C   s2   t  }|t|  }t }| ||tj d S )N)r   r$   r;   r%   r   r@   r   rA   )r(   r)   cdatar+   r   r   r,   test_roundtrip_xz  s    z0CompressorDecompressorTestCase.test_roundtrip_xzc             C   s6   t tj}|t|  }t }| ||tj d S )N)	r   r   r#   r$   r;   r%   r   r@   rB   )r(   r)   ri   r+   r   r   r,   test_roundtrip_alone  s    
z3CompressorDecompressorTestCase.test_roundtrip_alonec             C   sB   t tjtd}|t|  }ttjtd}| ||tj	 d S )N)r   )
r   r   r    rN   r$   r;   r%   r   r@   rB   )r(   r)   ri   r+   r   r   r,   test_roundtrip_raw   s    z1CompressorDecompressorTestCase.test_roundtrip_rawc             C   sp   t tjtd}|t}||d7 }||d7 }||d7 }|| 7 }ttjtd}| ||tj	 d S )N)r   r7   )
r   r   r    rN   r$   r;   r%   r   r@   rB   )r(   r)   ri   r+   r   r   r,   test_roundtrip_raw_empty&  s    
z7CompressorDecompressorTestCase.test_roundtrip_raw_emptyc          	   C   sr   t  }g }x4tdttdD ] }||t||d   qW ||  d|}t }| 	||t
j d S )Nr   rQ   r7   )r   rR   rS   r;   rT   r$   r%   rU   r   r@   r   rA   )r(   r)   ri   rV   r+   r   r   r,   test_roundtrip_chunks0  s     
z4CompressorDecompressorTestCase.test_roundtrip_chunksc          	   C   s   t  }g }xdtdttdD ]P}||t||d   ||d ||d ||d qW ||  d|}t }| 	||t
j d S )Nr   rQ   r7   )r   rR   rS   r;   rT   r$   r%   rU   r   r@   r   rA   )r(   r)   ri   rV   r+   r   r   r,   test_roundtrip_empty_chunks:  s    
z:CompressorDecompressorTestCase.test_roundtrip_empty_chunksc             C   s"   t  }| j|tt tjtd d S )N)r=   )r   r@   r3   r5   r   rA   )r(   r+   r   r   r,   test_decompressor_multistreamI  s    z<CompressorDecompressorTestCase.test_decompressor_multistreamrY   rZ   )sizeZmemusec             C   s\   t  }|d| |  }t|}z*| t|| | t|dd W d d }X d S )N   xr   )r   r$   r%   r   r&   r:   rS   strip)r(   rq   r)   ri   ddatar   r   r,   test_compressor_bigmemP  s    
z5CompressorDecompressorTestCase.test_compressor_bigmemr   c             C   sh   t  }d}t|d |d}z4||| d  }t|}||}| || W d d  } }}X d S )Ni      little   )r   randomZgetrandbitsto_bytesr   r$   r&   r:   )r(   rq   r+   Z	blocksizeblockinputri   rt   r   r   r,   test_decompressor_bigmem[  s    

z7CompressorDecompressorTestCase.test_decompressor_bigmemc          
   C   sd   x^t tjd D ]L}| t tt | W d Q R X | t tt | W d Q R X qW d S )Nrx   )rR   pickleZHIGHEST_PROTOCOLr   r   dumpsr   r   )r(   protor   r   r,   test_picklej  s
    z*CompressorDecompressorTestCase.test_picklec             C   sL   t td}t }| }xtdD ]}|  q"W | j| | ddd d S )NgettotalrefcountrY   r   rQ   )Zdelta)r   Zget_attributesysr   rR   __init__ZassertAlmostEqual)r(   r   r+   Zrefs_beforerV   r   r   r,   &test_refleaks_in_decompressor___init__q  s    zECompressorDecompressorTestCase.test_refleaks_in_decompressor___init__N)r7   )'__name__
__module____qualname__r-   r2   r4   r6   r@   rC   rD   rE   rG   rJ   rM   rP   rW   rX   r^   ra   rc   re   rf   rg   rh   rj   rk   rl   rm   rn   ro   rp   r	   r   ru   r}   r   r   Zrefcount_testr   r   r   r   r,   r      s@   (
 	

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 Q R X |  ttj |  ttjg  | j ttjddd | j ttjddd |  t tjdtji d W d Q R X |  t tjdtjdd W d Q R X |  t tjdtd	 W d Q R X |  t tjdtj	td W d Q R X |  t tjdtj
td W d Q R X d S )Nr7   Zxz)r   Znone)r   Zblah)r   i   )r   r   r   )r   r   r   g   1A)r   )r   r   i   )r   r   )r   r   r   r$   r   r   r&   r    r!   r"   r#   )r(   r   r   r,   test_bad_args  s.    "z0CompressDecompressFunctionTestCase.test_bad_argsc          	   C   sx   |  t tjtdd W d Q R X |  t tjttjdd W d Q R X |  t tjttjdd W d Q R X d S )Ni   )r   )r   r   )r   r   r   r&   r3   r"   r5   r#   )r(   r   r   r,   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 )N)r   )r   r&   r3   r:   r;   r5   r"   r#   rF   r    r!   rI   rH   rL   rK   rO   rN   )r(   rt   r   r   r,   test_decompress_good_input  s(    

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   r   r&   r3   r5   rF   r    r!   rI   rH   rL   rK   rO   rN   )r(   r   r   r,    test_decompress_incomplete_input  s    zCCompressDecompressFunctionTestCase.test_decompress_incomplete_inputc          	   C   s   |  t tt W d Q R X |  t tt W d Q R X |  t tjttjd W d Q R X |  t tjttj	d W d Q R X |  t tjttj
td W d Q R X d S )N)r   )r   r   )r   r   r   r&   COMPRESSED_BOGUSrF   r5   r"   r3   r#   r    r!   )r(   r   r   r,   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 )N)r   )	r   r$   r;   r&   r:   r"   r#   r    rN   )r(   ri   rt   r   r   r,   test_roundtrip  s    



z1CompressDecompressFunctionTestCase.test_roundtripc             C   s"   t tt }| |td  d S )NrZ   )r   r&   r3   r5   r:   r;   )r(   rt   r   r   r,   test_decompress_multistream  s    z>CompressDecompressFunctionTestCase.test_decompress_multistreamc             C   s   t tt }| |t d S )N)r   r&   r3   r   r:   r;   )r(   rt   r   r   r,   test_decompress_trailing_junk  s    z@CompressDecompressFunctionTestCase.test_decompress_trailing_junkc             C   s&   t td t }| |td  d S )Nr   )r   r&   r3   r   r:   r;   )r(   rt   r   r   r,   )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   r,   r   {  s   r   c               @   s*   e Zd ZdZd
ddZdd Zdd Zd	S )TempFilez=Context manager - creates a file, and deletes it on __exit__.r7   c             C   s   || _ || _d S )N)filenamer>   )r(   r   r>   r   r   r,   r     s    zTempFile.__init__c          	   C   s(   t | jd}|| j W d Q R X d S )Nwb)openr   writer>   )r(   fr   r   r,   	__enter__	  s    zTempFile.__enter__c             G   s   t | j d S )N)r   r   )r(   argsr   r   r,   __exit__  s    zTempFile.__exit__N)r7   )r   r   r   __doc__r   r   r   r   r   r   r,   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>dyS )zFileTestCasec          	   C   sd   t tt}W d Q R X t t d}W d Q R X t t d}W d Q R X t t d}W d Q R X d S )Nwxa)r   r   r3   )r(   r   r   r   r,   	test_init  s    


zFileTestCase.test_initc          
   C   s   t t}t|tr t|}| | t W d Q R X t|d}|	t W d Q R X t|}| | td  W d Q R X W d Q R X d S )Nr   rZ   )
pathlibPathr   r   r3   r   r:   readr;   r   )r(   r   r   r   r   r,    test_init_with_PathLike_filename  s    


z-FileTestCase.test_init_with_PathLike_filenamec          
   C   sZ   t ttF tt}W d Q R X ttd}W d Q R X ttd}W d Q R X W d Q R X d S )Nr   r   )r   r   r3   r   )r(   r   r   r   r,   test_init_with_filename'  s    


z$FileTestCase.test_init_with_filenamec          
   C   s   t t ttd W d Q R X ttd W d Q R X ttd W d Q R X ttd W d Q R X ttd W d Q R X ttd W d Q R X W d Q R X d S )Nrrbr   r   r   ab)r   r   r   )r(   r   r   r,   test_init_mode0  s    





zFileTestCase.test_init_modec             C   sh   |  tt xVdD ]N}tt tt| W d Q R X | t tt| W d Q R X W d Q R X qW d S )N)r   xb)
addCleanupr   r   r   r   FileExistsError)r(   moder   r   r,   test_init_with_x_mode?  s    

z"FileTestCase.test_init_with_x_modec          	   C   s  |  t tttd W d Q R X |  t tttd W d Q R X |  t tttd W d Q R X |  t tttd W d Q R X |  t tttd W d Q R X |  t tttd W d Q R X |  t tttd W d Q R X |  t tttd W d Q R X |  t tttd	 W d Q R X |  t tttd
 W d Q R X |  t tttd W d Q R X d S )N)r   r   r   xtzx+rxZwxrtzr+wtzw+rw)r   r   r   r   r3   )r(   r   r   r,   test_init_bad_modeI  s,    zFileTestCase.test_init_bad_modec          	   C   sF  |  t tt ddd W d Q R X |  t tt dtjd W d Q R X |  t tt dtjd d W d Q R X |  t ttt	tj
d W d Q R X |  t ttt	tjd W d Q R X |  t ttt	tjd W d Q R X |  t ttt	tjd W d Q R X |  t ttt	tjd W d Q R X d S )Nr   s   asd)r   r   )r   r   r   r   r   r   CHECK_UNKNOWNCHECK_ID_MAXr   r3   rB   CHECK_CRC32rA   ZCHECK_SHA256)r(   r   r   r,   test_init_bad_checka  s      z FileTestCase.test_init_bad_checkc          	   C   s  |  t tt ddd W d Q R X |  t tt ddd W d Q R X |  t tt ddd W d Q R X |  t tt ddd W d Q R X |  t tt ddd W d Q R X |  t tt ddd W d Q R X |  t tttd	d W d Q R X d S )
Nr   g(\@)r   rQ      r\   ir/   r   )r   r   r   r   r   OverflowErrorr   r3   )r(   r   r   r,   test_init_bad_presetu  s    z!FileTestCase.test_init_bad_presetc          	   C   s  |  t tt ddgd W d Q R X |  t tt dddigd W d Q R X |  t tt dddigd W d Q R X |  t  tt dtjdd	gd W d Q R X |  t  tt dtjdd	gd W d Q R X |  t  tt dtjdd	gd W d Q R X d S )
Nr   s   wobsite)r   r.   r   r   í r   )r   r/   )	r   r   r   r   r   r   r   r0   r1   )r(   r   r   r,   test_init_bad_filter_spec  s      z&FileTestCase.test_init_bad_filter_specc          	   C   s0   |  t tt dtjdtd W d Q R X d S )Nr      )r   r   r   )r   r   r   r   r   r    r!   )r(   r   r   r,   !test_init_with_preset_and_filters  s    z.FileTestCase.test_init_with_preset_and_filtersc          	   C   s   t t6}t|}|  | |j |  | |j W d Q R X ttt0 tt}|j}|  | 	|j |  W d Q R X d S )N)
r   r3   r   closer8   closedr   r   _fpr<   )r(   srcr   fpr   r   r,   
test_close  s    
zFileTestCase.test_closec             C   s   t tt}z$| |j |  | |j W d |  X | |j t t d}z| |j W d |  X | |j d S )Nr   )r   r   r3   r8   r   r   r   r<   )r(   r   r   r   r,   test_closed  s    

zFileTestCase.test_closedc          	   C   s   t tt}z| t|j W d |  X | t|j tt	tD t t	}z*| 
| |j  | | t W d |  X W d Q R X | t|j d S )N)r   r   r3   r   r   filenor   r   r   r   r:   r   ZassertIsInstanceint)r(   r   r   r   r,   test_fileno  s    
zFileTestCase.test_filenoc             C   s   t tt}z(| |  |  | |  W d |  X | t|j t t d}z| 	|  W d |  X | t|j tt}dd |_t |}z| 	|  W d |  X | t|j d S )Nr   c               S   s   dS )NFr   r   r   r   r,   <lambda>  r7   z,FileTestCase.test_seekable.<locals>.<lambda>)
r   r   r3   r<   seekabler   r   r   r   r8   )r(   r   r   r   r   r,   test_seekable  s&    



zFileTestCase.test_seekablec             C   s   t tt}z(| |  |  | |  W d |  X | t|j t t d}z| 	|  W d |  X | t|j d S )Nr   )
r   r   r3   r<   readabler   r   r   r   r8   )r(   r   r   r   r,   test_readable  s    

zFileTestCase.test_readablec             C   s   t tt}z(| |  |  | |  W d |  X | t|j t t d}z| 	|  W d |  X | t|j d S )Nr   )
r   r   r3   r8   writabler   r   r   r   r<   )r(   r   r   r   r,   test_writable  s    

zFileTestCase.test_writablec          	   C   s  t tt&}| | t | | d W d Q R X t tt}| | t W d Q R X t tttjd&}| | t | | d W d Q R X t tttj	d&}| | t | | d W d Q R X t tt
tjtd&}| | t | | d W d Q R X t tttjtd&}| | t | | d W d Q R X t tttjtd&}| | t | | d W d Q R X t tttjtd&}| | t | | d W d Q R X d S )Nr7   )r   )r   r   )r   r   r3   r:   r   r;   r5   r   r"   r#   rF   r    r!   rI   rH   rL   rK   rO   rN   )r(   r   r   r   r,   	test_read  s6    zFileTestCase.test_readc          	   C   s   t tt}| |dd W d Q R X t tt}| |dd W d Q R X t tttjd}| |dd W d Q R X t tttjd}| |dd W d Q R X d S )Nr   r7   )r   )	r   r   r3   r:   r   r5   r   r"   r#   )r(   r   r   r   r,   test_read_0*  s    zFileTestCase.test_read_0c          	   C   sb   t ttL}g }x.|d}|s$P | t|d || qW | d|t	 W d Q R X d S )NrQ   r7   )
r   r   r3   r   r]   rS   rT   r:   rU   r;   )r(   r   Zchunksresultr   r   r,   test_read_104  s    
zFileTestCase.test_read_10c          	   C   s   t ttd }| | td  W d Q R X t ttt }| | td  W d Q R X t ttd tj	t
d}| | td  W d Q R X d S )Nrd   rZ      )r   r   )r   r   r3   r:   r   r;   r5   rL   r   r    rK   )r(   r   r   r   r,   test_read_multistream?  s    z"FileTestCase.test_read_multistreamc          	   C   sR   t j}ttt _z4tttd }| | td  W d Q R X W d |t _X d S )Nrd   )	_compressionBUFFER_SIZErS   r3   r   r   r:   r   r;   )r(   Zsaved_buffer_sizer   r   r   r,   )test_read_multistream_buffer_size_alignedH  s    
"z6FileTestCase.test_read_multistream_buffer_size_alignedc          	   C   s0   t ttt }| | t W d Q R X d S )N)r   r   r3   r   r:   r   r;   )r(   r   r   r   r,   test_read_trailing_junkS  s    z$FileTestCase.test_read_trailing_junkc          	   C   s8   t ttd t }| | td  W d Q R X d S )Nrd   )r   r   r3   r   r:   r   r;   )r(   r   r   r   r,   #test_read_multistream_trailing_junkW  s    z0FileTestCase.test_read_multistream_trailing_junkc          
   C   sN   t tt: tt&}| | t | | d W d Q R X W d Q R X d S )Nr7   )r   r   r3   r   r:   r   r;   )r(   r   r   r   r,   test_read_from_file[  s    
z FileTestCase.test_read_from_filec          
   C   s|   yt d}W n tk
r,   | d Y nX tt t: t|&}| | t	 | | d W d Q R X W d Q R X d S )Nasciiz%Temporary file name needs to be ASCIIr7   )
r   encodeUnicodeEncodeErrorskipTestr   r3   r   r:   r   r;   )r(   bytes_filenamer   r   r   r,   'test_read_from_file_with_bytes_filenamea  s    
z4FileTestCase.test_read_from_file_with_bytes_filenamec          	   C   s2   t ttd d }| t|j W d Q R X d S )Nr   )r   r   r3   r   r'   r   )r(   r   r   r   r,   test_read_incompletek  s    z!FileTestCase.test_read_incompletec          
   C   s   t d d }tt|}| t|j W d Q R X tt|,}| |ttt | t|jd W d Q R X x@t	dD ]4}tt|d | }| t|jd W d Q R X qzW d S )Nirx      )
r3   r   r   r   r'   r   r:   rS   r;   rR   )r(   Z	truncatedr   rV   r   r   r,   test_read_truncatedo  s    z FileTestCase.test_read_truncatedc          	   C   sv   t tt}|  | t|j t t d}| t|j W d Q R X t tt}| t|jt  W d Q R X d S )Nr   )	r   r   r3   r   r   r   r   r   float)r(   r   r   r   r,   test_read_bad_args}  s    zFileTestCase.test_read_bad_argsc          	   C   s*   t tt}| t|j W d Q R X d S )N)r   r   r   r   r   r   )r(   r   r   r   r,   test_read_bad_data  s    zFileTestCase.test_read_bad_datac          	   C   s`   t ttJ}g }x| }|s"P || qW | d|t | | d W d Q R X d S )Nr7   )r   r   r3   read1rT   r:   rU   r;   )r(   r   blocksr   r   r   r,   
test_read1  s    zFileTestCase.test_read1c          	   C   s.   t tt}| |dd W d Q R X d S )Nr   r7   )r   r   r3   r:   r   )r(   r   r   r   r,   test_read1_0  s    zFileTestCase.test_read1_0c          	   C   sb   t ttL}g }x|d}|s$P || qW | d|t | | d W d Q R X d S )NrQ   r7   )r   r   r3   r   rT   r:   rU   r;   )r(   r   r   r   r   r   r,   test_read1_10  s    
zFileTestCase.test_read1_10c          	   C   sh   t ttd N}g }x| }|s&P || qW | d|td  | | d W d Q R X d S )Nrd   r7   )r   r   r3   r   rT   r:   rU   r;   )r(   r   r   r   r   r   r,   test_read1_multistream  s    z#FileTestCase.test_read1_multistreamc          	   C   st   t tt}|  | t|j t t d}| t|j W d Q R X t tt}| t|jd  W d Q R X d S )Nr   )r   r   r3   r   r   r   r   r   )r(   r   r   r   r,   test_read1_bad_args  s    z FileTestCase.test_read1_bad_argsc          	   C   s   t tt>}| }| t|d | t| | 	|
 t W d Q R X t tt@}|d}| t|d | t| | 	|
 t W d Q R X d S )Nr   rQ   )r   r   r3   peekZassertGreaterrS   r<   r;   
startswithr:   r   )r(   r   r   r   r   r,   	test_peek  s    
zFileTestCase.test_peekc          	   C   s*   t t d}| t|j W d Q R X d S )Nr   )r   r   r   r   r   )r(   r   r   r   r,   test_peek_bad_args  s    zFileTestCase.test_peek_bad_argsc          	   C   s  t t}| }W d Q R X tt t}| tt|| W d Q R X tt t}| tt|| W d Q R X tt tt	j
d}| tt|| W d Q R X tt tt	jd}| tt|| W d Q R X tt tt	jtd}| tt|| W d Q R X d S )N)r   )r   r   )r   r;   	readlinesr   r3   assertListEquallistiterr5   r   r"   r#   rI   r    rH   )r(   r   linesr   r   r,   test_iterator  s    
zFileTestCase.test_iteratorc          	   C   sV   t t}| }W d Q R X tt t$}x|D ]}| | | q0W W d Q R X d S )N)r   r;   r   r   r3   r:   readline)r(   r   r   liner   r   r,   test_readline  s
    

zFileTestCase.test_readlinec          	   C   sH   t t}| }W d Q R X tt t}| | | W d Q R X d S )N)r   r;   r   r   r3   r   )r(   r   r   r   r   r,   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   rx   z)Excessive amount of data was decompressedN)r   r$   r   Z
assertLessrS   r   r   r   r   r:   r   r   r]   Z_bufferrawtell)r(   ZbombZdecompZ
max_decompr   r   r,   test_decompress_limited  s    z$FileTestCase.test_decompress_limitedc          
   C   s\  t  @}t|d}|t W d Q R X tt}| | | W d Q R X t  L}t|dtjd}|t W d Q R X tjttjd}| | | W d Q R X t  L}t|dtj	d}|t W d Q R X tjttj	d}| | | W d Q R X t  P}t|dtj
td}|t W d Q R X tjttj
td}| | | W d Q R X d S )Nr   )r   )r   r   )r   r   r   r;   r   r$   r:   getvaluer"   r#   r    rH   )r(   dstr   expectedr   r   r,   
test_write  s,    



zFileTestCase.test_writec          
   C   sv   t  f}t|d6}x.tdttdD ]}|t||d   q&W W d Q R X tt}| |	 | W d Q R X d S )Nr   r   rQ   )
r   r   rR   rS   r;   r   r   r$   r:   r  )r(   r  r   startr  r   r   r,   test_write_10  s    $
zFileTestCase.test_write_10c          
   C   s   t d d }t dd }t dd  }ddd |||fD }t v}t|d}|| W d Q R X t|d}|| W d Q R X t|d}|| W d Q R X | | | W d Q R X d S )Ni   i   r7   c             s   s   | ]}t |V  qd S )N)r   r$   ).0r   r   r   r,   	<genexpr>  s    z1FileTestCase.test_write_append.<locals>.<genexpr>r   r   )r;   rU   r   r   r   r:   r  )r(   part1part2part3r  r  r   r   r   r,   test_write_append  s    zFileTestCase.test_write_appendc          	   C   sd   zTt td}|t W d Q R X tt}ttd}| | | W d Q R X W d t	t X d S )Nr   r   )
r   r   r   r;   r   r$   r   r:   r   r   )r(   r   r  r   r   r,   test_write_to_file  s    
zFileTestCase.test_write_to_filec          	   C   s   yt d}W n tk
r,   | d Y nX zTt|d}|t W d Q R X tt}t	t d}| 
| | W d Q R X W d tt  X d S )Nr   z%Temporary file name needs to be ASCIIr   r   )r   r   r   r   r   r   r;   r   r$   r   r:   r   r   )r(   r   r   r  r   r   r,   &test_write_to_file_with_bytes_filename'  s    
z3FileTestCase.test_write_to_file_with_bytes_filenamec          	   C   s   t d d }t dd }t dd  }ddd |||fD }zttd}|| W d Q R X ttd}|| W d Q R X ttd}|| W d Q R X ttd}| | | W d Q R X W d tt X d S )	Ni   i   r7   c             s   s   | ]}t |V  qd S )N)r   r$   )r
  r   r   r   r,   r  9  s    z9FileTestCase.test_write_append_to_file.<locals>.<genexpr>r   r   r   )	r;   rU   r   r   r   r   r:   r   r   )r(   r  r  r  r  r   r   r   r,   test_write_append_to_file5  s    z&FileTestCase.test_write_append_to_filec          	   C   s   t t d}|  | t|jd t ttd}| t|jd W d Q R X t t d6}| t|jd  | t|jd | t|jd W d Q R X d S )Nr   s   foor   s   bartexti  )r   r   r   r   r   r   r3   r   )r(   r   r   r   r,   test_write_bad_argsF  s    z FileTestCase.test_write_bad_argsc          
   C   sl   t t}| }W d Q R X t  @}t|d}|| W d Q R X tt}| | | W d Q R X d S )Nr   )	r   r;   r   r   
writelinesr   r$   r:   r  )r(   r   r   r  r  r   r   r,   test_writelinesQ  s    

zFileTestCase.test_writelinesc          	   C   s>   t tt(}|d | | tdd   W d Q R X d S )Ni+  )r   r   r3   seekr:   r   r;   )r(   r   r   r   r,   test_seek_forwardZ  s    
zFileTestCase.test_seek_forwardc          	   C   sJ   t ttd 0}|ttd  | | tdd   W d Q R X d S )NrZ   {   )r   r   r3   r  rS   r;   r:   r   )r(   r   r   r   r,    test_seek_forward_across_streams_  s    z-FileTestCase.test_seek_forward_across_streamsc          	   C   sJ   t tt4}|d |dd | | tdd   W d Q R X d S )NrY   i  rx   i8  )r   r   r3   r   r  r:   r;   )r(   r   r   r   r,   %test_seek_forward_relative_to_currentd  s    
z2FileTestCase.test_seek_forward_relative_to_currentc          	   C   s@   t tt*}|dd | | tdd   W d Q R X d S )NirZ   )r   r   r3   r  r:   r   r;   )r(   r   r   r   r,   !test_seek_forward_relative_to_endj  s    z.FileTestCase.test_seek_forward_relative_to_endc          	   C   sH   t tt2}|d |d | | tdd   W d Q R X d S )Ni     )r   r   r3   r   r  r:   r;   )r(   r   r   r   r,   test_seek_backwardo  s    

zFileTestCase.test_seek_backwardc          	   C   sX   t ttd >}|ttd  |d | | tdd  t  W d Q R X d S )NrZ   iM  i  )r   r   r3   r   rS   r;   r  r:   )r(   r   r   r   r,   !test_seek_backward_across_streamsu  s    
z.FileTestCase.test_seek_backward_across_streamsc          	   C   s@   t tt*}|dd | | tdd   W d Q R X d S )NijrZ   )r   r   r3   r  r:   r   r;   )r(   r   r   r   r,   "test_seek_backward_relative_to_end{  s    z/FileTestCase.test_seek_backward_relative_to_endc          	   C   sR   t tt<}|ttd  | | tt | | d W d Q R X d S )Ni)#  r7   )	r   r   r3   r  rS   r;   r:   r  r   )r(   r   r   r   r,   test_seek_past_end  s    zFileTestCase.test_seek_past_endc          	   C   sF   t tt0}|d | | d | | t W d Q R X d S )Nir   )r   r   r3   r  r:   r  r   r;   )r(   r   r   r   r,   test_seek_past_start  s    
z!FileTestCase.test_seek_past_startc          	   C   s   t tt}|  | t|jd t t d}| t|jd W d Q R X t ttN}| t|jdd | ttf|jdd | t|jd  | t|jd W d Q R X d S )Nr   r   r   	   r   s   derp)r   r   r3   r   r   r   r  r   )r(   r   r   r   r,   test_seek_bad_args  s    zFileTestCase.test_seek_bad_argsc          	   C   s   t ttP}d}x0| | | |d}|s4P |t|7 }qW | | tt W d Q R X t t dZ}x>tdttdD ]*}| | | |	t||d   qW | | tt W d Q R X d S )Nr      r      )
r   r   r3   r:   r  r   rS   r;   rR   r   )r(   r   posr   r   r   r,   	test_tell  s    
zFileTestCase.test_tellc             C   s&   t tt}|  | t|j d S )N)r   r   r3   r   r   r   r  )r(   r   r   r   r,   test_tell_bad_args  s    zFileTestCase.test_tell_bad_argsN)?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   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     sx   

	

	
		
	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 Q R X t }t |d}|t W d Q R X t |	 }| |t t |d}|t W d Q R X t |	 }| |td  W d Q R X d S )Nr   r   r   rZ   )
r   r   r   r3   r:   r   r;   r   r&   r  )r(   r   bio	file_datar   r   r,   test_binary_modes  s    zOpenTestCase.test_binary_modesc          
   C   s   t d}|dtj}tttd}| 	|
 | W d Q R X t }t|d}|| W d Q R X t| d}| 	|| t|d}|| W d Q R X t| d}| 	||d  W d Q R X d S )Nr   
r   r   ZatrZ   )r;   decodereplaceoslinesepr   r   r   r3   r:   r   r   r&   r  )r(   uncompresseduncompressed_rawr   r+  r,  r   r   r,   test_text_modes  s    
zOpenTestCase.test_text_modesc          
   C   s   t t ttd}|t W d Q R X ttd }t| }| |t W d Q R X ttd}| | t W d Q R X ttd}|t W d Q R X ttd}| | td  W d Q R X W d Q R X d S )Nr   r   r   rZ   )	r   r   r   r   r   r;   r&   r   r:   )r(   r   r,  r   r   r,   test_filename  s    
zOpenTestCase.test_filenamec          
   C   s   t t}t| t|d}|t W d Q R X t|d }t|	 }| 
|t W d Q R X t|d}| 
|	 t W d Q R X W d Q R X d S )Nr   r   )r   r   r   r   r   r   r   r;   r&   r   r:   )r(   r   r   r,  r   r   r,   test_with_pathlike_filename  s    

z(OpenTestCase.test_with_pathlike_filenamec          	   C   s   |  t ttd W d Q R X |  t ttd W d Q R X |  t tjtddd W d Q R X |  t tjtddd W d Q R X |  t tjtddd	 W d Q R X d S )
Nr   Zrbtr   zutf-8)encodingignore)errorsr.  )newline)r   r   r   r   r   )r(   r   r   r,   test_bad_params  s    zOpenTestCase.test_bad_paramsc          
   C   s   t jtd}t jttdf|}| | t W d Q R X t J}t j|df|}|	t W d Q R X t j
| f|}| |t W d Q R X d S )N)r   r   r   r   )r   r    r!   r   r   rF   r:   r   r;   r   r&   r  )r(   optionsr   r+  r,  r   r   r,   test_format_and_filters  s    z$OpenTestCase.test_format_and_filtersc          
   C   s   t d}|dtj}t }tj|ddd}|| W d Q R X t	|
 d}| || |d tj|ddd}| | | W d Q R X W d Q R X d S )Nr   r.  r   z	utf-16-le)r8  r   r   )r;   r/  r0  r1  r2  r   r   r   r   r&   r  r:   r  r   )r(   r3  r4  r+  r   r,  r   r   r,   test_encoding  s    

zOpenTestCase.test_encodingc          
   C   sL   t td4}tj|dddd}| | d W d Q R X W d Q R X d S )Ns   foobarr   r   r9  )r8  r:  Zfoobar)r   r   r$   r   r:   r   )r(   r+  r   r   r   r,   test_encoding_error_handler  s    z(OpenTestCase.test_encoding_error_handlerc          
   C   s~   t d}t d}tj|ddd}|| W d Q R X |d tj|ddd}| | |g W d Q R X W d Q R X d S )Nr   r   r.  )r;  r   r   )	r;   r/  r   r   r   r   r  r:   r   )r(   r  r+  r   r   r   r,   test_newline  s    

zOpenTestCase.test_newlinec             C   sl   |  tt xZdD ]R}tt tt| W d Q R X | t tt| W d Q R X W d Q R X qW d S )N)r   r   r   )r   r   r   r   r   r   r   )r(   r   r   r   r,   test_x_mode  s    

zOpenTestCase.test_x_modeN)r   r   r   r-  r5  r6  r7  r<  r>  r?  r@  rB  rC  r   r   r   r,   r*    s   
r*  c               @   s,   e Zd Zdd Zdd Zdd Zdd Zd	S )
MiscellaneousTestCasec             C   sP   |  ttj |  ttj | ttjd  | ttj d S )Nrx   )r<   r   Zis_check_supportedrB   r   r8   r   r   )r(   r   r   r,   test_is_check_supported(  s    z-MiscellaneousTestCase.test_is_check_supportedc          	   C   s   |  t td W d Q R X |  t tddi W d Q R X |  t ttjdd W d Q R X |  tj ttjdd W d Q R X ttjdd	d
dd}| 	|d d S )Ns
   not a dictr      r   )r   Zjunki)#  )r   distrZ   r   r   i   )r   pblplc	dict_sizes   ]   )
r   r   r   _encode_filter_propertiesr   r   r   r0   FILTER_LZMA1r:   )r(   Zpropsr   r   r,   test__encode_filter_properties4  s     
z4MiscellaneousTestCase.test__encode_filter_propertiesc          	   C   s   |  t ttjdti W d Q R X |  tj ttjd W d Q R X ttjd}| 	|d tj | 	|d d | 	|d d | 	|d	 d
 | 	|d d d S )Nz	should bes   too longs   ]   r   rH  rZ   rI  r   rJ  r   rK  i   )
r   r   r   _decode_filter_propertiesr1   bytesr   r0   rM  r:   )r(   Z
filterspecr   r   r,   test__decode_filter_propertiesI  s    
z4MiscellaneousTestCase.test__decode_filter_propertiesc             C   s6   t t jd}t |}t t j|}| || d S )Ns   ]   )r   rO  rM  rL  r:   )r(   Zspec1Z	reencodedZspec2r   r   r,    test_filter_properties_roundtripX  s
    

z6MiscellaneousTestCase.test_filter_properties_roundtripN)r   r   r   rE  rN  rQ  rR  r   r   r   r,   rD  &  s   rD  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![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   r   r   r*  rD  r   r   r   r,   	test_main  s    rT  __main__)4r   ior   r   r   r1  r   r~   ry   r   Ztestr   ZunittestZtest.supportr   r   r   r	   r
   r   r   r   r   r   r   ZTestCaser   r   r   r   r*  rD  r;   r   r3   r5   r   r!   rF   r0   ZPRESET_DEFAULTZPRESET_EXTREMErH   rI   ZFILTER_IA64rK   rL   r1   rN   rO   rT  r   r   r   r   r,   <module>   sZ      j      #wz/+-
=
,

C	
