ó zfc@sÙddlZddlZddlZddljZddlmZm Z ej dƒdeej fd„ƒYZ deej fd„ƒYZ deej fd „ƒYZe e efZed krÕejeŒndS( iÿÿÿÿN(tAbstractTkTestt requires_tcltguitMiscTestcBseZd„Zd„ZRS(cCsC|jjƒ}|j|tƒ|jd|ƒ|jd|ƒdS(Ntphototbitmap(troott image_typestassertIsInstancettupletassertIn(tselfR((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyttest_image_types scCs#|jjƒ}|j|tƒdS(N(Rt image_namesRR (R R ((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 ƒƒ~|j d|jj ƒƒdS( Ns ::img::testtmastert foregroundtyellowt backgroundtbluetfileRi( ttkintert BitmapImageRRt assertEqualtstrttypetwidththeightR R t assertNotIn(R timage((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyttest_create_from_files  c Csât|jdƒ}|jƒ}WdQXtjdd|jddddd|ƒ}|jt|ƒdƒ|j|jƒd ƒ|j|j ƒd ƒ|j|j ƒd ƒ|j d|jj ƒƒ~|j d|jj ƒƒdS( Ntrbs ::img::testRRRRRtdataRi(topenRtreadR R!RR"R#R$R%R&R R R'(R tfR+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(R tactualtexpected((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 d ddd|fƒdS( Ns ::img::testRR+s-data {} {} {} {}R*s-datatitmaskdatas-maskdata {} {} {} {}s -maskdata( R R!RR"R,RR-t configureR3R%R&(R R(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&(R R(((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(R R(((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(R R(((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyttest_configure_foreground`s   ( RRt classmethodRR)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„Z d „Z d „Z ed d ƒd „ƒZed d ƒ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 TkVersiont wantobjectst_join(R targs((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'(R textRR(((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|d d ƒ|jd|jjƒƒ~|jd|jjƒƒdS( Nspython.RRR*s ::img::testRR+Ritlatin1RR4(RRR,R-R R>RR"R#R$R%R&RAtdecodeR R R'(R RERR.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&(R R(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&(R R(((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&(R R(((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(R R(((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&(R R(((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(R R(((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(R R(((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(R R(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(R R(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(R R(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@(R R(((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(R R(((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 ƒƒ|jtjdd d dƒtjdd|jdd dtjƒ}|j t |ƒdƒ|j |j ƒdƒ|j |j ƒdƒ|j |j ƒdƒ|j |jddƒ|jd dƒƒ|j |jddƒ|jdd ƒƒdS(Ns ::img::test2RRVRJRRiiiiRPt from_coordsiii s ::img::test3iiii(iiii (R?t addCleanupRtunlinktTESTFNtwriteR R>RR"R#R$R%R&Rb(R R(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.pyts     RÜ