python (3.11.7)

(root)/
lib/
python3.11/
test/
__pycache__/
test_imghdr.cpython-311.opt-1.pyc

eAddlZddlZddlZddlZddlZddlmZmZddlm	Z	m
Z
ejdZdZ
GddejZGdd	ejZed
krejdSdS)N)findfilewarnings_helper)TESTFNunlinkimghdr))
python.pngpng)z
python.gifgif)z
python.bmpbmp)z
python.ppmppm)z
python.pgmpgm)z
python.pbmpbm)z
python.jpgjpeg)zpython-raw.jpgr)z
python.rasrast)z
python.sgirgb)zpython.tifftiff)z
python.xbmxbm)zpython.webpwebp)z
python.exrexrceZdZdZdZdS)UnseekableIOctjNioUnsupportedOperationselfs D/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/test/test_imghdr.pytellzUnseekableIO.tell%%ctjrr)rargskwargss   rseekzUnseekableIO.seek!r!r"N)__name__
__module____qualname__r r&r"rrrs2&&&&&&&&r"rcleZdZedZdZdZdZdZdZ	dZ
dZd	Zd
Z
dZdZd
ZdS)
TestImghdrctdd|_t|jd5}||_ddddS#1swxYwYdS)Nr
imghdrdatasubdirrb)rtestfileopenreadtestdata)clsstreams  r
setUpClasszTestImghdr.setUpClass%s\BBB
#,
%
%	)!;;==CL	)	)	)	)	)	)	)	)	)	)	)	)	)	)	)	)	)	)sAAAc.ttdSr)rrrs rtearDownzTestImghdr.tearDown+svr"c	tD]B\}}t|d}|t||t|d5}|t||dddn#1swxYwYt|d5}|}dddn#1swxYwY|td|||tdt||DdS)Nr.r/r1)
TEST_FILESrassertEqualrwhatr3r4	bytearray)rfilenameexpectedr7datas     r	test_datazTestImghdr.test_data.s",	K	KHh>>>HV[[22H===h%%
@  V!4!4h???
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@h%%
%{{}}
%
%
%
%
%
%
%
%
%
%
%
%
%
%
%V[[t44h???V[[y??JJJJ	K	Ks$/BB	B	3CC	C	c	tD]\}}||5t|d}|tt
j||dddn#1swxYwYdS)N)r@r.r/)r<subTestrr=rr>pathlibPath)rr@rAs   rtest_pathlike_filenamez!TestImghdr.test_pathlike_filename9s",	P	PHhx00
P
P#H\BBB  W\(-C-C!D!DhOOO
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P	P	PsABB	B	cd}tj||tjj|tddddS)Nc4|drdSdS)Neggsham)
startswith)hfiles  r
test_jumboz1TestImghdr.test_register_test.<locals>.test_jumbo@s%||G$$
u

r"rKrL)rtestsappend
addCleanuppopr=r>)rrPs  rtest_register_testzTestImghdr.test_register_test?sj				J'''()))T733U;;;;;r"cttd5}|d|}||jdddn#1swxYwYttd5}|||t|d|||ddddS#1swxYwYdS)Nwbs
ababagalamagar1r	)	r3rwriter r5r&r=rr>)rr7poss   r
test_file_poszTestImghdr.test_file_posGs]
&$

	(6LL)***++--CLL'''	(	(	(	(	(	(	(	(	(	(	(	(	(	(	(&$

	16KKV[[00%888V[[]]C000	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1s%AA&&A*-A*A,C??DDc|t5tdddn#1swxYwY|t5tddddn#1swxYwY|t5t|jddddn#1swxYwY|t5tt
j|jdddn#1swxYwYt|jd5}|t5t|	dddn#1swxYwYddddS#1swxYwYdS)Nr1)
assertRaises	TypeErrorrr>AttributeErrorr2osfsencoder3fileno)rfs  r
test_bad_argszTestImghdr.test_bad_argsQs


y
)
)		KKMMM															


~
.
.		KK															


y
)
)	*	*KK
q)))	*	*	*	*	*	*	*	*	*	*	*	*	*	*	*


~
.
.	4	4KKDM22333	4	4	4	4	4	4	4	4	4	4	4	4	4	4	4
$-
&
&	(!"">22
(
(AHHJJ'''
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(	(	(	(	(	(	(	(	(	(	(	(	(	(	(	(	(	(	(s}AAA&B

BB2!CC#&C#2EE	E"G=-F6*G6F:	:G=F:	>GGGcldD]0}|td|1dS)N)sPN
ssYscutecats	000000JFIsGIF80)assertIsNonerr>)rheaders  rtest_invalid_headerszTestImghdr.test_invalid_headers^sD!	9	9F
fkk$778888
	9	9r"ctj5tjdttD]\}}t|d}t
|d5}|d}dddn#1swxYwY|	t5ttj|dddn#1swxYwY|	t5td|dddn#1swxYwY	ddddS#1swxYwYdS)Nignorer.r/r1latin1)warningscatch_warningssimplefilterBytesWarningr<rr3r4decoder]r^rr>rStringIO)rr@_r7rBs     rtest_string_datazTestImghdr.test_string_datags2

$
&
&		,		,!(L999)
,
,!#H\BBB(D)):V!;;==//99D:::::::::::::::&&y1133KKD 1 1222333333333333333&&y11,,KKd+++,,,,,,,,,,,,,,,

,		,		,		,		,		,		,		,		,		,		,		,		,		,		,		,		,		,		,s~A	E(BEBEBE6-C/#E/C33E6C37ED<0E<EEEEEEc|t5tdddddS#1swxYwYdS)Nmissing)r]FileNotFoundErrorrr>rs rtest_missing_filezTestImghdr.test_missing_filess


0
1
1	#	#KK	"""	#	#	#	#	#	#	#	#	#	#	#	#	#	#	#	#	#	#sAA
Act|jd}||t5}t
|dddn#1swxYwYtj|j	}||t5}t
|ddddS#1swxYwYdS)Nr1)
r3r2closer]
ValueErrorrr>rBytesIOr5rr7cms   rtest_closed_filezTestImghdr.test_closed_filews=dmT**


z
*
*	 bKK	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 DM**


z
*
*	 bKK	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 s$A++A/2A/=C%%C),C)cttd5}||jdddn#1swxYwYt	td5}|tj5t	|dddn#1swxYwYddddS#1swxYwYdS)NrWr1)
r3rrXr5rr]rrrr>)rr7s  rtest_unseekablezTestImghdr.test_unseekablesg
&$

	(6LL'''	(	(	(	(	(	(	(	(	(	(	(	(	(	(	(
&$
'
'	$6""2#:;;
$
$F###
$
$
$
$
$
$
$
$
$
$
$
$
$
$
$	$	$	$	$	$	$	$	$	$	$	$	$	$	$	$	$	$	$sE=AA B<=B$B<$B(	(B<+B(	,B<<CCcXttd5}||j|d|t5}t|dddn#1swxYwYddddS#1swxYwYdS)NrWr)	r3rrXr5r&r]OSErrorrr>r|s   rtest_output_streamzTestImghdr.test_output_streams
&$

	$6LL'''KKNNN""7++
$rF###
$
$
$
$
$
$
$
$
$
$
$
$
$
$
$	$	$	$	$	$	$	$	$	$	$	$	$	$	$	$	$	$	$s6A
B B;BB	BB	BB#&B#N)r'r(r)classmethodr8r:rCrHrUrZrdrhrsrwr~rrr*r"rr,r,$s))[)
	K	K	KPPP<<<111(((999
,
,
,###   $$$$$$$$r"r,__main__)rr`rFunittestrltest.supportrrtest.support.os_helperrrimport_deprecatedrr<FileIOrTestCaser,r'mainr*r"r<module>rs								2222222211111111	*	*8	4	4
"&&&&&29&&&i$i$i$i$i$"i$i$i$VzHMOOOOOr"