7ec@sddlZddlZddlZddljZddlmZm Z ej ddeej fdYZ deej fdYZ deej fd YZe e efZed krejendS( iN(tAbstractTkTestt requires_tcltguitMiscTestcBseZdZdZRS(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|tdS(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 tBitmapImageTestcBsVeZedZdZdZdZdZdZdZ dZ 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 Cstjdd|jddddd|j}|jt|d|j|jd|j|jd |j|jd |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 Cst|jd}|j}WdQXtjdd|jddddd|}|jt|d|j|jd |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.pytassertEqualStrList8scCstjdd|j}|j|ddt|jd}|j}WdQX|jd||j|ddddd|f|j|j d|j|j d|j|d d |jd ||j|d d ddd|fdS( 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  cCstjdd|j}|j|dd|jd|j|j|ddddd|jf|j|jd|j|jd|j|dd |jd|j|j|dd ddd|jfdS( 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|dddS(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|dddS(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     tPhotoImageTestcBseZedZdZdZdZdZdZdZ dZ dZ d Z d Z ed d d Zed d dZdZdZdZdZdZdZdZdZdZdZdZdZdZRS(cCs,tjj|tjddd|_dS(Ns python.gifRR(RRRRRR(R((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyRkscCstjdd|jd|jS(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 colorlisttscCstjd|dd}tjdd|jd|}|jt|d|j|jd|j|jd|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|jjdS( 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_datas cCs|jddS(Ntppm(RF(R ((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyttest_create_from_ppm_filescCs|jddS(NRJ(RI(R ((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyttest_create_from_ppm_datascCs|jddS(Ntpgm(RF(R ((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyttest_create_from_pgm_filescCs|jddS(NRM(RI(R ((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyttest_create_from_pgm_datascCs|jddS(Ntgif(RF(R ((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyttest_create_from_gif_filescCs|jddS(NRP(RI(R ((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyttest_create_from_gif_datasiicCs|jddS(Ntpng(RF(R ((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyttest_create_from_png_filescCs|jddS(NRS(RI(R ((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyttest_create_from_png_datascCstjdd|j}|j|ddt|jd}|j}WdQX|jd||j|d|jr|n |j d|j|j d|j|j ddS(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.pyR7scCstjdd|j}|j|dd|jd|jdd|j|d|jradnd|j|jd|j|jddS( 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_formatscCstjdd|j}|j|dd|jd|j|j|d|j|j|jd|j|jddS(Ns ::img::testRRR4i(R R>RR"R6RR%R&(R R(((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyR9s cCsTtjdd|j}|j|dd|jdd|j|dddS(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_gammascCstjdd|j}|j|dd|j|dd|jdd|jdd|j|dd|j|dd |j|jd|j|jddS( 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_heightscCsxtjdd|j}|j|dd|jdd|j|dd|jdd|j|dddS(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_palettes cCsq|j}|j|j|jd|j|jd|j|jdd|jddddS(Niiii(R?tblankR"R%R&tgetRD(R R(((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyt test_blanks   cCsp|j}|j}|j|jd|j|jd|j|jdd|jdddS(Niii(R?tcopyR"R%R&Rb(R R(timage2((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyt test_copys   cCs|j}|jdd}|j|jd|j|jd|j|jdd|jdd|jd}|j|jd|j|jd|j|jdd|jdddS(Niiiii(R?t subsampleR"R%R&Rb(R R(Re((s</usr/lib64/python2.7/lib-tk/test/test_tkinter/test_images.pyttest_subsamples (cCs)|j}|jdd}|j|jd|j|jd|j|jdd|jdd|j|jd d |jdd|jd}|j|jd|j|jd|j|jdd |jdd|j|jd d |jdddS( 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|jddddS(Ns{red green} {blue yellow}ttoiiiiig333333!@iis#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>itiiiii(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|jtjtjdd|jdddtj}|j t |d|j |j d|j |j d|j |j d|j |jdd|jdd|j |jd d |jd d |jtjdd d dtjdd|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