python (3.12.0)

(root)/
lib/
python3.12/
test/
__pycache__/
test_zlib.cpython-312.opt-1.pyc

Αe$ddlZddlmZddlmZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZmZm
Z
mZejdZej"eej'ddZej"eej+ddZGd	d
ej.ZGddej.ZGd
dej.ZGddej.ZGddeZGddeej.ZGddeej.Zde	fdZ dZ!Gddej.Z"GddZ#e$dk(rejJyy)N)support)
import_helper)
bigmemtest_1G_4G
skip_on_s390xzlibcopyzrequires Compress.copy()zrequires Decompress.copy()ceZdZdZy)VersionTestCasecl|jtjdtjdy)Nr)assertEqualr	ZLIB_RUNTIME_VERSIONZLIB_VERSIONselfs B/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/test/test_zlib.pytest_library_versionz$VersionTestCase.test_library_version3s*	
2215t7H7H7KLN)__name__
__module____qualname__rrrrr1sMrrc6eZdZdZdZdZdZdZdZdZ	y)	ChecksumTestCasec|jtjdtjdd|jtjddy)Nrrabc)rr	crc32
assertTruers rtest_crc32startz ChecksumTestCase.test_crc32start>s<C$**S!*<=

6:67rc|jtjddd|jtjddd|jtjdddyNrri)rr	rrs rtest_crc32emptyz ChecksumTestCase.test_crc32emptyBsSC+Q/C+Q/C-s3rc|jtjdtjdd|jtjddy)Nrr$rr)rr	adler32r rs rtest_adler32startz"ChecksumTestCase.test_adler32startGs=c*DLLa,@AVZ89rc|jtjddd|jtjddd|jtjdddyr#)rr	r'rs rtest_adler32emptyz"ChecksumTestCase.test_adler32emptyKsSc1-q1c1-q1c3/5rc|jtjddd|jtjddd|jtjddd|jtjddd|jtjdtjdd|jtjdtjddy)Nspenguinrl !Kr$iCiirr	rr'rs r
test_penguinszChecksumTestCase.test_penguinsPsJ2K@J2J?j!4jAj!4jAJ/J1JKj1$,,z!2LMrc6d}|jtj|d|jtjdd|jtj||zd|jtjddy)Nabcdefghijklmnop@u(spami=Cl
*iOr,)rfoos  rtest_crc32_adler32_unsignedz,ChecksumTestCase.test_crc32_adler32_unsignedYsn!C*5G,j9c#g.
;g.9rcd}d}|jtj|||jtj|||jtjdtjdy)Nr/r0r1)rbinasciirr	)rr2crcs   rtest_same_as_binascii_crc32z,ChecksumTestCase.test_same_as_binascii_crc32as_!,c2C#.0$**W2EFrN)
rrrr!r%r(r*r-r3r7rrrrr<s'84
:6
N:Grrc4eZdZeedzdddZy)ChecksumBigBufferTestCaser$F)sizememusedry_runcdtdzz}|jtj|d|jtj	|dy)Nsnyanr$iM"B>la
)rrr	rr')rr;datas   rtest_big_bufferz)ChecksumBigBufferTestCase.test_big_bufferlsB#'"D):6d+Z8rN)rrrrrr@rrrr9r9js!S1WQ6979rr9creZdZdZdZdZdZdZejdZ
ejdZy)	ExceptionTestCasecd|jtjtjddy)NsERROR
)assertRaisesr	errorcompressrs r
test_badlevelzExceptionTestCase.test_badlevelus 	
$**dmmXrBrcf|jttj|jttj|jttj
|jttjdddddgfD]}|jttj||jttj||jttj
||jttj|y)N*abcr)rE	TypeErrorr	r'rrG
decompress)rargs  rtest_badargszExceptionTestCase.test_badargs{s)T\\2)TZZ0)T]]3)T__5b%R0	?Cis;iS9i<i#>		?rc|jttjdtjd|jttjdtjtj
dzy)Nr$r)rE
ValueErrorr	compressobjDEFLATED	MAX_WBITSrs rtest_badcompressobjz%ExceptionTestCase.test_badcompressobjsO*d&6&64==!L*  !T]]DNNQ4F	HrcN|jttjdy)N)rErRr	
decompressobjrs rtest_baddecompressobjz'ExceptionTestCase.test_baddecompressobjs*d&8&8"=rc|jttjjd|jttjjdy)NrrX)rErRr	rYflushrs rtest_decompressobj_badflushz-ExceptionTestCase.test_decompressobj_badflushsD*d&8&8&:&@&@!D*d&8&8&:&@&@"Erc(|jtd5tjddtj
dzddd|jtd5tj
jdtj
dzddd|jtd5tj
jtj
dzdddy#1swYxYw#1swYixYw#1swYyxYw)Nz
int too largerr$)assertRaisesRegex
OverflowErrorr	rNsysmaxsizerYr\rs r
test_overflowzExceptionTestCase.test_overflows

#
#M?
C	6OOCS[[1_5	6

#
#M?
C	B ++CqA	B

#
#M?
C	8 &&s{{Q7	8	8		6	6	B	B	8	8s#)C06C<25D0C9<DDctj|ttj	tj|ttjyN)rcheck_disallow_instantiationtyper	rSrYrs rtest_disallow_instantiationz-ExceptionTestCase.test_disallow_instantiations@	,,T48H8H8J3KL,,T48J8J8L3MNrN)rrrrHrPrVrZr]rcpython_onlyrdrirrrrBrBssTC	?H>F

88
OOrrBceZdZdZdZy)BaseCompressTestCasecd}tj|dz}||t|zdzz}	||d}y#d}wxYw)NrDr$)random	randbyteslen)rr;
compress_func_1Mr?s     rcheck_big_compress_bufferz.BaseCompressTestCase.check_big_compress_buffersOb)ts4y(1,-	$D4Ds;?cd|z}	tj|d}d}||}	|jt|||jt|j	ddd}y#d}wxYw#d}wxYw)Nxr$r)r	rGrrqstrip)rr;decompress_funcr?
compresseds     rcheck_big_decompress_bufferz0BaseCompressTestCase.check_big_decompress_buffers~d{	tQ/JDz*	SY-SD!12A6DDDsA0AA70A47A;N)rrrrtrzrrrrlrls
rrlceZdZdZdZedZdZee	dzddZ
ee	dzd	d
ZeeddZ
d
Zej ej$dkDdeedzddZy)CompressTestCasectjt}|jtj	|tyrf)r	rGHAMLET_SCENErrNrxs  rtest_speechzCompressTestCase.test_speechs)MM,'+\:rctjtd}|jtj	|t|jt5tjtdddd|jtj	|tjtjty#1swYRxYw)N)level)r?r)wbitsbufsize)	r	rGr~rrNrErMrUDEF_BUF_SIZErs  r
test_keywordszCompressTestCase.test_keywordssMM,aM0+\:


y
)	6MM|1M5	6/3~~151B1B)D&	'	6	6sCCc
tdz}tj|}|jtjt	|||t	|fD]'}|jtj||)yN)r~r	rGr	bytearrayrN)rr?robs    rtest_speech128zCompressTestCase.test_speech128sic!MM$y7;Yq\/	8BT__R0$7	8rctjt}|jtjdtj
|ddy)NzAError -5 while decompressing data: incomplete or truncated streamrX)r	rGr~r`rFrNrs  rtest_incomplete_streamz'CompressTestCase.test_incomplete_streams6MM,'tzzOOOQsV	%rrnrr;r<c.d}|j||y)Nc.tj|dSNr$)r	rG)ss r<lambda>z;CompressTestCase.test_big_compress_buffer.<locals>.<lambda>sT]]1a0r)rt)rr;rGs   rtest_big_compress_bufferz)CompressTestCase.test_big_compress_buffers0&&tX6rcD|j|tjyrf)rzr	rN)rr;s  rtest_big_decompress_bufferz+CompressTestCase.test_big_decompress_buffers((t?rr$ctdz}tj|d}|jtj	|d||yNrDr$r_)r~r	rGrrN)rr;r?rys    rtest_large_bufsizez#CompressTestCase.test_large_bufsizes;b ]]4+
R>Erctdz}tj|d}|jtj	|dt|yr)r~r	rGrrN	CustomInt)rr?rys   rtest_custom_bufsizez$CompressTestCase.test_custom_bufsizes;b ]]4+
REtLrrequires 64bit platformdr:cd|z}	tj|d}|jtj||dx}}y#dx}}wxYwNrvr)r	rGrrN)rr;r?comps    rtest_64bit_compressz$CompressTestCase.test_64bit_compresssPd{	==q)DT__T2D9D4$D4s;AA
N)rrrrrrrrrrrrrrrunittest
skipUnlessrbrcrrrrr|r|s;'88%S;&q1727S;&q1@2@S#F$FM
Xu,.GHS3Yq)*Irr|ceZdZedZdZdZdZd4dZdZ	d5dZ
d6d	Zd
ZdZ
dZd
ZdZdZej&eedddZdZdZdZdZdZdZdZdZdZe e!ddZ"dZ#e$d Z%e$d!Z&e'd"Z(e'd#Z)d$Z*d%Z+e e,d&zd'd(Z-e e,d&zd)d*Z.ej&e/j`d+kDd,e e!d-zd.d/Z1ej&e/j`d+kDd,e e!d-zd'd0Z2ej&e/j`d+kDd,e e!d-zd1d2Z3d3Z4y)7CompressObjectTestCasectdz}tj|}|t|fD]v}tj	}|j|}|j}|j
tj|j
|j||z|xft|t|ffD]\}}tj}	|	j||z}
|	j}|j|
|z|j|	jt|j|	jtyr)r~r	rGrrSr\rErFrrYrNassertIsInstanceunconsumed_tailbytesunused_data)rdatasrcdatazipr?cox1x2v1v2dcoy1y2s            r	test_pairz CompressObjectTestCase.test_pairs$--(i01	/D!!#BT"BBdjj"((3R"Wg.	/Bx)B-2!?@	:FB$$&CR(BBT27+!!#"5"5u=!!#//59
	:rcd}tj}d}d}tj}tj|||||d}tj	|d}|jt5|jtddd|jt5|jtjtddd|jt|jz}|j|tt|jz}	|jt|	y#1swYxYw#1swYxYw)	Nr	r)rmethodrmemLevelstrategyzdictrr)r?
max_length)
r	rT
Z_FILTEREDrSrYrErMrGr~rNr\rqr)
rrrrrrrdorys
          rrz$CompressObjectTestCase.test_keywordss??


E%+$)'/'/$')

e3

7


y
)	+KK\K*	+


y
)	<MMt}}\:M;	<KK%
2MM!L(9M:RXXZGq)
	+	+	<	<s.E"*EEEcpd}tj}d}d}tj}tj|||||}|j	t
}|j
}tj|}	|	j||z}
|	j
}|jt
|
|zy)Nrrr)
r	rTrrSrGr~r\rYrNr)rrrrrrrrrrrrs            rtest_compressoptionsz+CompressObjectTestCase.test_compressoptions1s??


eVUHh
G
[[
&
XXZ  '
^^BG
$
YY[rBw/rc	tdz}tj}g}tdt	|dD](}|j|j
|||dz*|j|jdj|}tj}|jdj|}|j}|j|||zy)Nrrr)r~r	rSrangerqappendrGr\joinrYrNr)	rr?rbufsicombufrrrs	         rtest_compressincrementalz/CompressObjectTestCase.test_compressincremental@sc!



q#d)S)	4AKKD1S5M23	4BHHJ$  "
^^CHHTN
+
YY[rBw'rNc	j|xst}|dz}tj}g}tdt	||D](}|j|j
||||z*|j|jdj|}	tj|	}
|j|
t|j||
tj}g}tdt	|	|D]w}|j|j|	|||z|jd|jdt	|jz|jd|jy|r |j|jn(	|jd}|r|j|nn'|jd|jdt	|jz|jd|j|j|dj|y)Nrrrz"(A) uct should be b'': not %d longz"(B) uct should be b'': not %d long)r~r	rSrrqrrGr\rrNrrrrYrr)
rr\sourcecxdcxr?rrrrdecombufrchunks
             rtest_decompincz%CompressObjectTestCase.test_decompincOs'<|



q#d)R(	3AKKD1R4L12	3BHHJ$??6*h.x(  "q#f+s+	3AKKva#78S#"5"5A'*3+>+>'?@
A
S#//2	3KK		$s+KK&	
c11='*3+>+>'?@	A	
coo.sxx~.rc(|jdyNT)r\)rrs rtest_decompincflushz*CompressObjectTestCase.test_decompincflushxs$'rc	|xst}|dz}tj}g}tdt	||D](}|j|j
||||z*|j|jdj|}|j|tj|dtj}	g}|}
|
r^|	j|
|}|jt	||kDdt	||fz|j||	j}
|
r^|j|	j|j|dj|dy)Nrrrcompressed data failurechunk too big (%d>%d)Wrong data retrievedr~r	rSrrqrrGr\rrrNrYassertFalser)rrrrr?rrrrrcbrs            rtest_decompimaxz&CompressObjectTestCase.test_decompimax{sC'<|



q#d)R(	3AKKD1R4L12	3BHHJ$tv62	4  "
NN2s+ESZ#-+s5z3.??
AKK$$B
	
CIIK sxx~/EFrc	tdz}tj}g}tdt	|dD](}|j|j
|||dz*|j|jdj|}|j|tj|dtj}g}|}|rodt	|dzz}	|j||	}
|jt	|
|	kDdt	|
|	fz|j|
|j}|ro|r |j|jnT
rR|jd	}
|jt	|
|	kDdt	|
|	fz|j|
|
rR|j|dj|d	y)
Nrrrrrr$rDrrr)rr\r?rrrrrrrrs           rtest_decompressmaxlenz,CompressObjectTestCase.test_decompressmaxlensc!



q#d)S)	4AKKD1S5M23	4BHHJ$tv62	4  "
SWb[JNN2z2ESZ*4/3u:j2II
KKK$$B
KK		$sJ7  Uj!83s5z*6MMOE"	
	
sxx~/EFrc(|jdyr)rrs rtest_decompressmaxlenflushz1CompressObjectTestCase.test_decompressmaxlenflushs""".rctj}|jt|jdd|jd|jy)NrrX)r	rYrErRrNrr)rrs  rtest_maxlenmiscz&CompressObjectTestCase.test_maxlenmiscs>  "*cnnc2>c112rctdz}|jt|tjtj|d}tj
}|j|j|tj|yNrDr$)r~
assertGreaterrqr	rrGrYrrNrbrcrr?ryrs    rtest_maxlen_largez(CompressObjectTestCase.test_maxlen_largeseb 3t9d&7&78]]4+
  "
CKK@$Grctdz}tj|d}tj}|j	|j|t
|ddy)NrDr$r)r~r	rGrYrrNrrs    rtest_maxlen_customz)CompressObjectTestCase.test_maxlen_customsMb ]]4+
  "
IK@$t*Mrcd}tj}|j|d}||j|jz
}|j	|jdy)Ns
xKLJMr$r)r	rYrNrr)rcdatarddatas    rtest_clear_unconsumed_tailz1CompressObjectTestCase.test_clear_unconsumed_tailsV-  "ua(
 3 344,,c2rcgd}tdtjjdD}|dk\r|j	d|Dcgc]"}tt|rt
t|$}}tdz}|D]}tdD]}	tj|}|j|dd}|j|}	|j|dd}
|j}|jtjd
j!||	|
|g|d||fz~ycc}w#td	j||xYw)N)
Z_NO_FLUSHZ_SYNC_FLUSHZ_FULL_FLUSHZ_PARTIAL_FLUSHc32K|]}t|ywrf)int).0vs  r	<genexpr>z6CompressObjectTestCase.test_flushes.<locals>.<genexpr>sIqCFIs.)r$rrZ_BLOCKrDiz!Error for flush mode={}, level={}rz*Decompress failed: flush mode=%i, level=%i)tupler	rsplitrhasattrgetattrr~rrSrGr\printformatrrNr)rsync_optveroptr?syncrobjabcds            rtest_flushesz#CompressObjectTestCase.test_flushess\'ID$=$=$C$CC$HII,OOI&2:+3tS)D#&++a	Dr
	**E3Cd5Dk3A		4)Ad45k3A		A
  1Qq)1D!E!%)<@De}(MN
		+=!6$.0s'D6AD;;Erzrequires zlib.Z_SYNC_FLUSHcddl}tjtj}tj	}	|j
}|jd|jd}|j|}|jtj}|j||z}|j||dy#t$r'	|j}n#t$r|}YnwxYwYwxYw)Nrr$iDz17K random source doesn't match)ror	rSZ_BEST_COMPRESSIONrYWichmannHillAttributeErrorRandomseedrprGr\rrNr)	rrorrgenr?firstsecondexpandeds	         rtest_odd_flushz%CompressObjectTestCase.test_odd_flushs	

d55
6  "		%&%%'C	}}Y'D!$++,>>%&.1	
4)JK!	
#fmmo!

		s5C	C8C$#C8$C2/C81C22C87C8ctjtj}|j|j	tj}|j
|j	dy)Nr)r	rSrr r\rYr)rrrs   rtest_empty_flushz'CompressObjectTestCase.test_empty_flushsP


d55
6
#  "c*rct}|j}tj|dj	|}t
j
|}|j||jz}t
j|}|j|j||jz|t
j}|jt
j|j|y)Nrr)r~rroshufflerr	rSrGr\rYrrNrErF)rhwordsrrcdrs       rtest_dictionaryz&CompressObjectTestCase.test_dictionary#s	u


E

*
[[^bhhj
(  u -+ciik91=  "$**cnnb9rctjt}tjt}tdd}|j	||jtjz}|j	|dd|jtjz}|j	|dd|jtjz}|j|j|||j|j||dd|j|j||ddy)Nr#iri)	r	rSr~rYrGr\rrrN)rrrpieced0d1d2s       rtest_dictionary_streamingz0CompressObjectTestCase.test_dictionary_streaming3s

L

1


l

3T$'
[[
"((4+<+<"=
=
[[st
%1B1B(C
C
[[u
&$2C2C)D
Dr*E2r*E#$K8r*E%4L9rcPd}|jtj|d|jtjtj|ddtj}|j|dd}||j
z
}|j|dy)NxKEsfoo)rr	rNrErFrYr\)rrrrs    r!test_decompress_incomplete_streamz8CompressObjectTestCase.test_decompress_incomplete_stream@s2+V4$**dooq"v>  "NN1Sb6"	SYY[F#rcxd}tj}|j|j|j	|dd|j|j|j	|dd|j|j|j
|j|jyNr1r2)r	rYreofrNr r\rrrs   rtest_decompress_eofz*CompressObjectTestCase.test_decompress_eofMs2  "!q"v!qv 		 rcd}tj}|j|j|j	|dd|j|j|j|j|jyr5)r	rYrr6rNr\r7s   r%test_decompress_eof_incomplete_streamz<CompressObjectTestCase.test_decompress_eof_incomplete_streamXsf2  "!q"v!		!rcd}d}tj|}||z}dD]Y}ddt|t|fD]:}tj}d}t	dt||D]}	|	t|kr|j|jd|dk(r7||j||	|	|zz
}|j|jdi||j|j||	|	|zz|z
}||jz
}|j|j|j|||j|jd|j|j|=\y)Nabcdefghijklmnopqrstuvwxyzs
0123456789)rr*r$rrr)r	rGrqrYrrrrNrr\r r6)
rr	remainderrrmaxlensteprr?rs
          rtest_decompress_unused_dataz2CompressObjectTestCase.test_decompress_unused_dataask/!	MM&!
	M	=F1c!fc!f,
=((*q#a&$/OA3q6z((#>{qQX ??(()<)<cB # 3 3aAHo Ev!OOO		#(  v.  !4!4c:  )<!
=	=rcLd}tjtj|}|j||j	z}tjtj|}|j
||j	z}|j||y)Nr<r)r	rSrUrGr\rYrNr)rrrrruncomps      r#test_decompress_raw_with_dictionaryz:CompressObjectTestCase.test_decompress_raw_with_dictionary|s-


T^^O5

A{{5!BHHJ.  e D%		3'rcd}d}tj|}tj}|j|d~tj|}|j	|j|ddy)Nr<sQWERTYUIOPASDFGHJKLZXCVBNMr$)r	rGrYrNrr\)rinput1input2r?rs     rtest_flush_with_freed_inputz2CompressObjectTestCase.test_flush_with_freed_inputse/.}}V$  "tQ}}V$fQRj1rr$rctdz}tj|d}tj}|j	|d|j|j
||ddyr)r~r	rGrYrNrr\)rr;inputr?rs     rtest_flush_large_lengthz.CompressObjectTestCase.test_flush_large_lengthsXr!}}UA&  "tQ4%)4rctdz}tj|d}tj}|j	|d|j|j
t|ddyr)r~r	rGrYrNrr\r)rrIr?rs    rtest_flush_custom_lengthz/CompressObjectTestCase.test_flush_custom_lengthsYr!}}UA&  "tQ9;/qr;rc6t}tttdjd}dtjtj
fD]E}tjtj}g}|j|j|||}|dd}|j|j||j|jdj|}|j|j||j|jdj|}	|jtj|||z|jtj|	||zHy)Nasciic"|jSrfr
rs rrz:CompressObjectTestCase.test_compresscopy.<locals>.<lambda>affhrr)r~rstrswapcaser
deepcopyr	rSrrrGr\rrrN)
rdata0data1funcc0bufs0c1bufs1s0s1s
          rtest_compresscopyz(CompressObjectTestCase.test_compresscopys'c,099;WE&		4==@	>D!!$"9"9:BELLU+,bB!HELLU+,LL$%BLLU+,LL$%BT__R0u=T__R0u=#	>rcJtj}|jt|j	|jt|j|jttj||jttj|yrf)	r	rSrGr~r\rErRr
rU)rrs  rtest_badcompresscopyz+CompressObjectTestCase.test_badcompresscopysg
	

< 		*aff-*dii3*dmmQ7rcXt}tj|}|j|tdt
j
t
jfD]}tj}g}|j|j|dd||}|dd}|j|j|dddj|}|j|j|dddj|}	|j||	|j||y)Nc"|jSrfrPrQs rrz<CompressObjectTestCase.test_decompresscopy.<locals>.<lambda>rRr r)r~r	rGrrr
rUrYrrNrr)
rr?rrXr,rZr-r\r]r^s
          rtest_decompresscopyz*CompressObjectTestCase.test_decompresscopys}}T"dE*&		4==@	&D##%BELLtCRy12bB!HELLtBCy12%BLLtBCy12%BR#R%	&rcttjt}tj}|j	||j|j
t|j|j
ttj||j
ttj|yrf)
r	rGr~rYrNr\rErRr
rU)rr?rs   rtest_baddecompresscopyz-CompressObjectTestCase.test_baddecompresscopysu}}\* 	T		*aff-*dii3*dmmQ7rc(ttjdzD]g}|jttj
f5tjtjtj|dddiy#1swYtxYwr)
rpickleHIGHEST_PROTOCOLrErM
PicklingErrordumpsr	rSrrprotos  rtest_compresspicklez*CompressObjectTestCase.test_compresspicklesz622Q67	OE""Iv/C/C#DE
OT--d.E.EFN
O
O	O
O
Os8BB	c
ttjdzD]X}|jttj
f5tjtj|dddZy#1swYexYwr)	rrirjrErMrkrlr	rYrms  rtest_decompresspicklez,CompressObjectTestCase.test_decompresspicklesk622Q67	:E""Iv/C/C#DE
:T//159
:
:	:
:
:s)A99B	rnrc^tjdfd}|j||y)Nr$cHj|jzSrf)rGr\)rrs rrzACompressObjectTestCase.test_big_compress_buffer.<locals>.<lambda>sQZZ]QWWY6r)r	rSrt)rr;rGrs   @rrz/CompressObjectTestCase.test_big_compress_buffers(Q6&&tX6rrc\tjfd}|j||y)NcHj|jzSrf)rNr\)rrs rrzCCompressObjectTestCase.test_big_decompress_buffer.<locals>.<lambda>sq||A:r)r	rYrz)rr;rNrs   @rrz1CompressObjectTestCase.test_big_decompress_buffers& :
((z:rrrrr:c0d|z}tjd}tj}	|j||j	z}|j||j	z}|j
||dx}x}}y#dx}x}}wxYwr)r	rSrYrGr\rNr)rr;r?rrrrBs       rrz*CompressObjectTestCase.test_64bit_compresssd{


a
 



!	(;;t$rxxz1D]]4(288:5FVT*#''D'6D4'D'6DsAB

Bc.d}d|z}tj||z}tj}	|j||j	z}|j||j|j||dx}x}}y#dx}x}}wxYw)Nr/rv)r	rGrYrNr\rr)rr;r?unusedrrrBs       rtest_large_unused_dataz-CompressObjectTestCase.test_large_unused_datas#}}T"V+



!	&]]4(288:5FVR^^4VT*!%%F%TB%F%TBsABBrc(d|z}tj}	tj|d}|j|d|j	z}|j|||j|jddx}x}}y#dx}x}}wxYw)Nrvrr$r)r	rYrGrNr\rr)rr;r?rrrBs      rtest_large_unconsumed_tailz1CompressObjectTestCase.test_large_unconsumed_tailsd{



!	(==q)D]]4+bhhj8FVT*R//5#''D'6D4'D'6DsA'B		Bctjjdddjd}t|dkr|j	dn|djsd|d<t
tt|}|dk\}tjdd	
}|jt|jz}|jtj|d	t|r*|jtj|dt|jtj|dt|jtj d5tj|d
dddtj#d}|j|j|ttj#d
}|jtj d5|j|dddtjdd
}|jt|jz}|jtj|dt|jtj|d	t|r*|jtj|dt|jtj|dttj#d}|j|j|ttjdd
}|jt|jz}|jtj|dttj#d}|j|j|ttjdd
}|jt|jz}|jtj|dt|jtj|dttj#d}|j|j|ttjdd
}|jt|jz}	|jtj|	dt|jtj|	dttj#d}|j|j|	tdD]e}
|j%|
5t}tjtjt|
|
}|j||dddgy#1swY[xYw#1swYxYw#1swYxYw)N-r$rrr:0rX)r$rrrr_)rr/zinvalid window size)rr)i)rr_r)r	rrrqr	isnumericrmaprrSrGr~r\rrNr`rFrYsubTest)
rrsupports_wbits_0rzlib15rzlib9	deflate15deflate9gziprexpectedactuals
             r
test_wbitsz!CompressObjectTestCase.test_wbits&su
%%++C3A6<<SAq6A:
HHSM2"AbE#c1+,


AR

0\*RXXZ74lCT__VQ7F9<H

#
#DJJ0E
F	(OOFB'	(  w //>  r *

#
#DJJ0E
F	#NN6"	#

AQ

/L)BHHJ62LA3\BT__UA6E7F  v ..=


AS

1KK-
:	C8,G  s +	2LA


AR

0;;|,rxxz926E37F  r *1<@


AW

5{{<(288:5w7Fw7F  )-|<"	3EE*
3'MM,eM<E)  62
3
3	3M	(	(
	#	#D
3
3s%&W6W#A	W0W #W-0W9	)FNr@)Nrr)F)5rrrrrrrrrrrrrrrrrrrrrr	rr!r(r/r3r8r:r@rCrGrrrJrLrequires_Compress_copyr_rarequires_Decompress_copyrergrorqrrrrbrcrryr{rrrrrrs<::&**
0
(&/R(G6G@/3HN3@X~657L7L@+: :$	!"=6(
2S#5$5<>>.88&&088O
:S;&q1727
S;&q1;2;
Xu,.GHS3Yq)	(*I	(Xu,.GHS3Yq)
&*I
&Xu,.GHS3Yq)	(*I	(?3rrc||j||jd}t|Dcgc]}|j|c}Scc}w)z=Return a list of number lines randomly chosen from the source
)rrrchoice)rnumberr	generatorsourcesns      rchoose_linesrgsEtll4 G/4V}=!IW%===sA
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.
c$eZdZeZej
eZdZede	ezdzzZ
ej
e
ZdZdZ
dZdZdZej$eed	zd
dZd
ZdZdZdZdZdZej8dZy)ZlibDecompressorTestsNot a valid deflate blockir$c|jttjd|jttjdd|jttjdddy)NASDArnotbytessbytesr)rErMr	_ZlibDecompressorrs rtest_Constructorz%ZlibDecompressorTest.test_ConstructorsP)T%;%;VD)T%;%;S*M)T%;%;S(ANrctj}|jt|j|j	|j
}|j
||jyrf)r	rrErMrNDATArTEXTrzlibdtexts   rtestDecompressz#ZlibDecompressorTest.testDecompresssN&&()U%5%56		*tyy)rctj}d}d}	|j|dz|dzdz}|sn||j|z
}|dz
}5|j	||j
y)NrrrDr$)r	rrrNrr)rrrrrSs     rtestDecompressChunks10z+ZlibDecompressorTest.testDecompressChunks10sx&&(
))AbD!A#r*CE$$S))D
FA	
tyy)rctj}d}|j|j|z}|j	||j
|j	|j|y)Nsthis is unused data)r	rrNrrrr)rrrrs    rtestDecompressUnusedDataz-ZlibDecompressorTest.testDecompressUnusedDatasX&&(,		+ 56tyy)**K8rctj}|j|j}|j	t
|jd|j	t
|jdy)Nsanythingr)r	rrNrrEEOFErrorrs   rtestEOFErrorz!ZlibDecompressorTest.testEOFErrorsT&&(		*(E$4$4kB(E$4$4c:rrgffffff
@rc"td|}tj|}	||dz
|zdzz}tj	|}tj}|j
|}|j||k(d}d}d}y#d}d}d}wxYw)Nir$)minrorpr	rGrrNr )rr;	blocksizeblockr?ryrdecompresseds        rtestDecompress4Gz%ZlibDecompressorTest.testDecompress4Gs($/	  +		 T!V	1A56Dt,J**,E ++J7LOOLD01DJLDJLsABBcttjdzD]H}|jt5tj
tj|dddJy#1swYUxYwr)rrirjrErMrlr	rrms  r
testPicklezZlibDecompressorTest.testPickles`622Q67	>E""9-
>T335u=
>
>	>
>
>s)A))A2	ctj}d}g}t|jdz
}|j	|j|jd|||j
|j|jt|d||j	|jd||j
|j|jt|d||j	|j|j|d||jt|d||jsM|j	|jd||jt|d||jsMdj|}|j||j|j|jdy)NrrrrXr)r	rrqBIG_DATArrNrneeds_inputrassertLessEqualr6rBIG_TEXTr)rrroutlen_s     rtestDecompressorChunksMaxsizez2ZlibDecompressorTest.testDecompressorChunksMaxsizes&&(
4==!B&

5##DMM%4$8-7$9	:**+SWz2	

5##CJ#?@**+SWz2	

5##DMM$%$8-7$9	:SR\:6))JJu''
'CD  SWz:))hhsmdmm,**C0rctj}g}|j|j|jdddd|j|jdd|j|j|jddd|j|j|jdd|jdj
||jy)Nrrrrrir_r	rrrNrrrrrrrs   rtest_decompressor_inputbuf_1z1ZlibDecompressorTest.test_decompressor_inputbuf_1s&&(	
))$))DS/34*67:	<
	

5##C+,	

5##DIIc#$6;<	

5##DIIcdO45#		2rc8tj}g}|j|j|jdddd|j|jd|j|j|jddd|j|j|jddd|j|j|jdd|jdj
||jy)Nrrrir,rrs   rtest_decompressor_inputbuf_2z1ZlibDecompressorTest.test_decompressor_inputbuf_2's&&(	
))$))DS/34*67:	<

5##C()	

5##DIIc#$6:;	

5##DIIc#$6:;	

5##DIIcdO45#		2rctj}g}|j|j|jddd|j|j|jddd|j|j|jdd|jdj
||jy)Nrrrr)r	rrrNrrrrrs   rtest_decompressor_inputbuf_3z1ZlibDecompressorTest.test_decompressor_inputbuf_3<s&&(	

5##DIIdsOQ78	

5##DIIc#$6:;	

5##DIIcdO45#		2rctj}|jt|j|j
dz|jt|j|j
dzy)N)r	rrE	ExceptionrNBAD_DATA)rrs  rtest_failurez!ZlibDecompressorTest.test_failureLsR&&()U%5%5t}}r7IJ)U%5%5t}}r7IJrctjtd}tj	}|}tdD]}|j
|j||z
ddy)NgettotalrefcountrrrD)delta)r
get_attributerbr	rr__init__assertAlmostEqual)rrrrefs_beforers     rtest_refleaks_in___init__z.ZlibDecompressorTest.test_refleaks_in___init__Rsg"006HI&&(&(s	ANN	/1K?"MrN)rrrr~rr	rGrrrqrrrrrrrrskip_if_pgo_taskrrrrrrrrr
refcount_testrrrrrrsD==&D+H
c$i/145H}}X&HO
*
*9;
S3Ys+
 ,
 >
1>3,3*3 K
NNrrceZdZdZy)rcy)Nrrrs r	__index__zCustomInt.__index__]srN)rrrrrrrrr\srr__main__)&rtestrtest.supportrr5r
osrirorbrrrr
import_moduler	rrrSrrYrTestCaserrr9rBobjectrlr|rrr~rrrmainrrr<module>rsg&	


<<#}""6*,,,  "F+"$/8..""$f-$&>Mh''M*Gx((*G\9 1 190O))0Of6<?+X->->?D_	3183D3D_	3B'+f>>BiN8,,iNX
zHMMOr