Your IP : 3.137.221.114


Current Path : /lib64/python2.7/lib-tk/test/test_tkinter/
Upload File :
Current File : //lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyc

�
zfc@s�ddlZddlZddlZddljZddlmZm	Z	ej
d�deejfd��YZdeejfd��YZ
deejfd	��YZee
efZed
kr�eje�ndS(i����N(tAbstractTkTesttrequires_tcltguitMiscTestcBseZd�Zd�ZRS(cCsC|jj�}|j|t�|jd|�|jd|�dS(Ntphototbitmap(troottimage_typestassertIsInstancettupletassertIn(tselfR((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyttest_image_typesscCs#|jj�}|j|t�dS(N(Rtimage_namesRR	(RR
((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyttest_image_namess(t__name__t
__module__RR(((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyR
s	tBitmapImageTestcBsVeZed��Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
RS(cCs,tjj|�tjddd�|_dS(Ns
python.xbmtsubdirt
imghdrdata(Rt
setUpClasst__func__tsupporttfindfilettestfile(tcls((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyRsc
Cs�tjdd|jddddd|j�}|jt|�d�|j|j�d�|j|j�d	�|j|j�d	�|j	d|jj
��~|jd|jj
��dS(
Ns::img::testtmastert
foregroundtyellowt
backgroundtbluetfileRi(ttkintertBitmapImageRRtassertEqualtstrttypetwidththeightR
R
tassertNotIn(Rtimage((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyttest_create_from_filescCs�t|jd��}|j�}WdQXtjdd|jddddd|�}|jt|�d�|j|j�d	�|j|j	�d
�|j|j
�d
�|jd|jj��~|j
d|jj��dS(Ntrbs::img::testRRRRRtdataRi(topenRtreadR R!RR"R#R$R%R&R
R
R'(RtfR+R(((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyttest_create_from_data*s	cCs0|j|t�|j|jj|�|�dS(N(RR#R"Rt	splitlist(Rtactualtexpected((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pytassertEqualStrList8scCs�tjdd|j�}|j|dd�t|jd��}|j�}WdQX|jd|�|j|ddddd|f�|j|j	�d�|j|j
�d�|j|d	d
�|jd	|�|j|d	dddd|f�dS(Ns::img::testRR+s-data {} {} {} {}R*s-datatitmaskdatas-maskdata {} {} {} {}s	-maskdata(R R!RR"R,RR-t	configureR3R%R&(RR(R.R+((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyttest_configure_data<s

cCs�tjdd|j�}|j|dd�|jd|j�|j|ddddd|jf�|j|j�d�|j|j�d�|j|dd	�|jd|j�|j|dd
ddd|jf�dS(Ns::img::testRRs-file {} {} {} {}s-fileR4itmaskfiles-maskfile {} {} {} {}s	-maskfile(	R R!RR"R6RR3R%R&(RR(((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyttest_configure_fileLs

cCsTtjdd|j�}|j|dd�|jdd�|j|dd�dS(Ns::img::testRRs-background {} {} {} {}Rs-background {} {} {} blue(R R!RR"R6(RR(((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyttest_configure_backgroundZscCsTtjdd|j�}|j|dd�|jdd�|j|dd�dS(Ns::img::testRRs!-foreground {} {} #000000 #000000Rs -foreground {} {} #000000 yellow(R R!RR"R6(RR(((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyttest_configure_foreground`s

(RRtclassmethodRR)R/R3R7R9R:R;(((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyRs						tPhotoImageTestcBseZed��Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
edd�d
��Zedd�d��Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(cCs,tjj|�tjddd�|_dS(Ns
python.gifRR(RRRRRR(R((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyRkscCstjdd|jd|j�S(Ns::img::testRR(R t
PhotoImageRR(R((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pytcreatepscGs-tjdkr|jr|Stj|�SdS(Ng333333!@(R t	TkVersiontwantobjectst_join(Rtargs((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyt	colorlisttscCs�tjd|dd�}tjdd|jd|�}|jt|�d�|j|j�d�|j|j�d�|j|j	�d�|j|d	d
�|j|d|�|j
d|jj��~|jd|jj��dS(Nspython.RRs::img::testRRRiR+R4(
RRR R>RR"R#R$R%R&R
R
R'(RtextRR(((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pytcheck_create_from_filezs	cCs,tjd|dd�}t|d��}|j�}WdQXtjdd|jd|�}|jt|�d�|j|j	�d�|j|j
�d	�|j|j�d	�|j|d|jr�|n|j
d
��|j|dd�|jd|jj��~|jd|jj��dS(
Nspython.RRR*s::img::testRR+Ritlatin1RR4(RRR,R-R R>RR"R#R$R%R&RAtdecodeR
R
R'(RRERR.R+R(((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pytcheck_create_from_data�s	cCs|jd�dS(Ntppm(RF(R((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyttest_create_from_ppm_file�scCs|jd�dS(NRJ(RI(R((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyttest_create_from_ppm_data�scCs|jd�dS(Ntpgm(RF(R((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyttest_create_from_pgm_file�scCs|jd�dS(NRM(RI(R((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyttest_create_from_pgm_data�scCs|jd�dS(Ntgif(RF(R((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyttest_create_from_gif_file�scCs|jd�dS(NRP(RI(R((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyttest_create_from_gif_data�siicCs|jd�dS(Ntpng(RF(R((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyttest_create_from_png_file�scCs|jd�dS(NRS(RI(R((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyttest_create_from_png_data�scCs�tjdd|j�}|j|dd�t|jd��}|j�}WdQX|jd|�|j|d|jr|n|j	d��|j|j
�d�|j|j�d�dS(Ns::img::testRR+R4R*RGi(R R>RR"R,RR-R6RARHR%R&(RR(R.R+((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyR7�scCs�tjdd|j�}|j|dd�|jd|jdd�|j|d|jradnd�|j|j�d�|j|j�d�dS(	Ns::img::testRtformatR4RRPi(RP(	R R>RR"R6RRAR%R&(RR(((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyttest_configure_format�scCs�tjdd|j�}|j|dd�|jd|j�|j|d|j�|j|j�d�|j|j�d�dS(Ns::img::testRRR4i(R R>RR"R6RR%R&(RR(((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyR9�scCsTtjdd|j�}|j|dd�|jdd�|j|dd�dS(Ns::img::testRtgammas1.0g@s2.0(R R>RR"R6(RR(((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyttest_configure_gamma�scCs�tjdd|j�}|j|dd�|j|dd�|jdd�|jdd�|j|dd�|j|dd	�|j|j�d�|j|j�d�dS(
Ns::img::testRR%t0R&ii
t20t10(R R>RR"R6R%R&(RR(((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyttest_configure_width_height�scCsxtjdd|j�}|j|dd�|jdd�|j|dd�|jdd�|j|dd�dS(Ns::img::testRtpaletteR4it256s3/4/2(R R>RR"R6(RR(((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyttest_configure_palette�scCsq|j�}|j�|j|j�d�|j|j�d�|j|jdd�|jddd��dS(Niiii(R?tblankR"R%R&tgetRD(RR(((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyt
test_blank�s

cCsp|j�}|j�}|j|j�d�|j|j�d�|j|jdd�|jdd��dS(Niii(R?tcopyR"R%R&Rb(RR(timage2((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyt	test_copy�s
cCs�|j�}|jdd�}|j|j�d�|j|j�d�|j|jdd�|jdd��|jd�}|j|j�d�|j|j�d�|j|jdd�|jdd��dS(Niiiii(R?t	subsampleR"R%R&Rb(RR(Re((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyttest_subsample�s(cCs)|j�}|jdd�}|j|j�d�|j|j�d�|j|jdd�|jdd��|j|jd	d
�|jdd��|jd�}|j|j�d�|j|j�d�|j|jdd�|jdd��|j|jd	d�|jdd��dS(
Niii i0iiiii	iii
(R?tzoomR"R%R&Rb(RR(Re((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyt	test_zooms(((cCs�|j�}|jddd�|j|jdd�|jddd��|j|jdd�|jdtjdkr}d	ndd��|j|jdd
�|jddd��|j|jdd
�|jddd��|jddf�|j|jdd�|jddd��|j|jdd�|jddd��|j|jdd�|jddd��|j|jdd�|jddd��dS(Ns{red green} {blue yellow}ttoiii�iig333333!@i�is#f00s#00ff00s
#000000fffs
#ffffffff0000i(ii(s#f00s#00ff00(s
#000000fffs
#ffffffff0000(R?tputR"RbRDR R@(RR(((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyttest_puts+
+++++cCs|j�}|j|jdd�|jddd��|j|jdd�|jddd��|j|jdd�|jddd��|jtj|jdd�|jtj|jdd�|jtj|jd	d�|jtj|jdd	�dS(
Niii>iti�iii����i(R?R"RbRDtassertRaisesR tTclError(RR(((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyttest_get s+++c	Cs�|j�}|jtjtj�|jtj�tjdd|jdddtj�}|j	t
|�d�|j	|j�d�|j	|j�d�|j	|j
�d�|j	|jdd�|jdd��|j	|jd	d
�|jd	d
��|jtjdddd�tjdd|jdddtj�}|j	t
|�d�|j	|j�d�|j	|j�d�|j	|j
�d�|j	|jdd�|jd
d��|j	|jdd�|jdd
��dS(Ns::img::test2RRVRJRRiiiiRPtfrom_coordsiii	s::img::test3iiii(iiii	(R?t
addCleanupRtunlinktTESTFNtwriteR R>RR"R#R$R%R&Rb(RR(Retimage3((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyt
test_write*s,((((RRR<RR?RDRFRIRKRLRNRORQRRRRTRUR7RWR9RYR]R`RcRfRhRjRmRpRw(((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyR=is4																							
t__main__(tunittesttTkinterR tttkttest.test_supportttest_supportRttest_ttk.supportRRtrequirestTestCaseRRR=t	tests_guiRtrun_unittest(((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyt<module>s

R�

?>