7ec@sddlZddlZddlZddlZddlmZmZmZddl m Z m Z edde ej fdYZ de ej fdYZe efZed kreendS( iN(trequirest run_unittestt swap_attr(tAbstractTkTesttdestroy_default_roottguitLabeledScaleTestcBsGeZdZdZdZdZdZdZdZRS(cCs$|jjtt|jdS(N(troottupdate_idletaskstsuperRttearDown(tself((s</usr/lib64/python2.7/lib-tk/test/test_ttk/test_extensions.pyR s cCsltj|j}|jj}|j|jtj|j j |tj |j}|j}tj|jd|}|j|j r|j |j j ||jn(|j t|j j ||j~|jtj|j j |tj|j}tj|jd|}|jtj|jd|ttdrh|jtjtjndS(Ntvariablet last_type(tttkt LabeledScaleRt _variablet_nametdestroyt assertRaisesttkintertTclErrorttkt globalgetvart DoubleVart wantobjectst assertEqualtgettfloattIntVarthasattrtsystassertNotEqualR (R txtvartmyvartname((s</usr/lib64/python2.7/lib-tk/test/test_ttk/test_extensions.pyttest_widget_destroys&     %( c CsttddttdtizYtj}|jtj|j|j tj|j|j tjj |j Wdt XWdQXWdQXdS(Nt _default_roott_support_default_root( RRtNonetTrueRRtassertIsNotNoneR&RtmasterRRR(R R!((s</usr/lib64/python2.7/lib-tk/test/test_ttk/test_extensions.pyttest_initialization_no_master2s cstjj}tj|}j|j||jddddtj dtj dff}j r}|d7}nxK|D]C}tjjd|d}j|j |d|jqWtjjdd }j t |jj|jtjjdd}j t |jj|jtjjd d }tjjd |}j|j d|jtjjd |dd }j|j d j|jj|j|jfd}tjjdd}||jd|jd|jtjjdd}||jd|jd|jtjjdd}||jd|jd|jtjj}||jd|jd|jj tjtj|dddS(Nt0ii iig@itfrom_s2.5tvalueiR g?cs8j|jd|j|jd|dS(Ntsidetanchor(Rt pack_infot place_info(tscalet scale_postlabelt label_pos(R (s</usr/lib64/python2.7/lib-tk/test/test_ttk/test_extensions.pytcheck_positionsastcompoundttoptbottomtntstunknowntatb(R-i(ii(i i (ii(g@i((g@i(RtFrameRRRRR+RRtmaxintRR/Rt ValueErrorRRR(RRR4R6R(R R+R!tpassed_expectedtpairR#R8((R s</usr/lib64/python2.7/lib-tk/test/test_ttk/test_extensions.pyttest_initialization?sP              cCs^tj|jdddd}|j|j|j|jj}|jj d}|j |t |d|jj dddd|j|jj d}|j |||jj}|j |jd|jrdnd |j |t |d|jj dddd|j |||j |t |d|jdS( NR.ittoi R!iittextR-(RRRtpacktwait_visibilitytupdateR6R3R4tcoordsRtintt configureR RR(R tlscaletlinfo_1t prev_xcoordt curr_xcoordtlinfo_2((s</usr/lib64/python2.7/lib-tk/test/test_ttk/test_extensions.pyttest_horizontal_rangevs$    &cCsvtj|j}|j|j|j|jjd}|jd}||_|j|j |j d|j r|n t ||j |jjd||j |jjdt|j jd|j rd}nt}||jdd|_|j|j ||j d||j |jjdt|j jd|jdS(NiiRHR!cSs|S(N((R!((s</usr/lib64/python2.7/lib-tk/test/test_ttk/test_extensions.pyttRG(RRRRIRJRKR4RLR/RR6Rtstrt assertGreaterRMR3R(R R!RRtnewvaltconv((s</usr/lib64/python2.7/lib-tk/test/test_ttk/test_extensions.pyttest_variable_changes,         cCstj|j}|jdtdd|j|j|jj|jj }}|d|d}}d|_ |j|jj d||f|j t |jjd|jjd|jj d||f|jdS( Ntexpandtfilltbothiis%dx%dR!i(RRRRIR)RJRKR+t winfo_widtht winfo_heightR/t wm_geometryRRMR6R3R4RLR(R R!twidththeightt width_newt height_new((s</usr/lib64/python2.7/lib-tk/test/test_ttk/test_extensions.pyt test_resizes    ( t__name__t __module__R R%R,RFRTR[Rf(((s</usr/lib64/python2.7/lib-tk/test/test_ttk/test_extensions.pyR s  " 7  tOptionMenuTestcBs>eZdZdZdZdZdZdZRS(cCs,tt|jtj|j|_dS(N(R RitsetUpRt StringVarRttextvar(R ((s</usr/lib64/python2.7/lib-tk/test/test_ttk/test_extensions.pyRjscCs|`tt|jdS(N(RlR RiR (R ((s</usr/lib64/python2.7/lib-tk/test/test_ttk/test_extensions.pyR scCstj|j}tj|j|}|j}|j|j|j|j j ||j ~|j tj |j j |dS(N(RRkRRt OptionMenuRRRRRRRRR(R R"toptmenuR$((s</usr/lib64/python2.7/lib-tk/test/test_ttk/test_extensions.pyR%s   "cCs|jtjtj|j|jddtj|j|jddd}|j|jj d|j |d|j |d|j dS(NtinvalidtthingR@R?tmenut textvariable( RRRRRmRRlRRRt assertTrueR(R Rn((s</usr/lib64/python2.7/lib-tk/test/test_ttk/test_extensions.pyRFs !c s7d d}tjjj|}t}xYttD]E}|dj|d}j||||krCt }qCqCWj ||j d}tjjj|}d}d}xQt r&||dj |d}}||kr Pnj|||d7}qWj|t|j|j|djdj|jjdjtj|djd j|jjd|j gfd }tjjjdd |}|djds)jd n|j dS(NR?R@tcRqR/tdiiics%j|djtdS(Ni(RtappendR)(titem(titemsR tsuccess(s</usr/lib64/python2.7/lib-tk/test/test_ttk/test_extensions.pytcb_teststcommandsMenu callback not invoked(R?R@Rt(RRmRRltFalsetrangetlent entrycgetRR)RsRR(tentryconfigureR RIRJtinvokeRRRRRtfail( R tdefaultRnt found_defaulttiR/tcurrtlastRz((RxR Rys</usr/lib64/python2.7/lib-tk/test/test_ttk/test_extensions.pyt test_menusJ          cCs;d }d}tj|j|j||}tj|j}tj|j|||}|j|j|j|j|djd|djd|dj dd}|dj dd}|j |||j |jj j ||d|j |jj j ||d|j|jdS( NR?R@RtRqiiiR (R?R@Rt(RRmRRlRRkRIRJRRR RRRR(R RxRRnttextvar2toptmenu2toptmenu_stringvar_nametoptmenu2_stringvar_name((s</usr/lib64/python2.7/lib-tk/test/test_ttk/test_extensions.pyttest_unique_radiobuttonss*        (RgRhRjR R%RFRR(((s</usr/lib64/python2.7/lib-tk/test/test_ttk/test_extensions.pyRis    4t__main__(RtunittesttTkinterRRttest.test_supportRRRttest_ttk.supportRRtTestCaseRRit tests_guiRg(((s</usr/lib64/python2.7/lib-tk/test/test_ttk/test_extensions.pyts     q