ó n”þfc@s»ddlZddlZddlZdefd„ƒYZdefd„ƒYZdejfd„ƒYZdejfd „ƒYZeefZ e d kr·dd l m Z e e ŒndS( iÿÿÿÿNt MockTclObjcBs eZdZd„Zd„ZRS(ttestcCs ||_dS(N(tval(tselfR((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyt__init__ scCs t|jƒS(N(tunicodeR(R((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyt__str__ s(t__name__t __module__ttypenameRR(((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyRs t MockStateSpeccBs eZdZd„Zd„ZRS(t StateSpeccGs ||_dS(N(R(Rtargs((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyRscCsdj|jƒS(Nt (tjoinR(R((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyRs(RRR RR(((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyR s tInternalFunctionsTestcBsbeZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z RS( cs ‡fd†}ˆjtjiƒƒ|tjidd6ddddgd6ƒidd 6d d 6ƒ|tjidBd6ƒidd6ƒ|tjiidd6d6ƒiidd6d6ƒ|tjiddd dd gd6dd6d d6dd6dd6dd6dd6dtƒid d6d!d"6dd#6d$d%6d&d'6d(d)6d*d+6ƒitd,6td-6}|jƒ}|tj|ƒitd.6td/6ƒˆj||ƒ|tjidCd26ƒid3d46ƒ|tjidDd26ƒid6d46ƒ|tjidEd26ƒid8d46ƒ|tjidFd26ƒid:d46ƒ|tjidGd26ƒid=d46ƒ|tjidHd26ƒid?d46ƒttj|d@d-ƒƒd}ˆj|t|ƒdƒttj|d@dIƒƒd}ˆj|t|ƒdƒˆjtj|d@|jƒƒƒdS(JNcsfxEtdt|ƒdƒD]+}ˆj|j||ƒ||dƒqW|rbˆjd|ƒndS(Niiisresult still got elements: %s(trangetlent assertEqualtpoptfail(tfmt_optstresultti(R(s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyt check_againsts)tbluetfgiiiitpaddings-fgs1 2 3 4s-paddingtiRs1 2 {} 0s-testsas istleftiÿÿÿÿt2mttest2ttest3sabc defttest4s"abc"ttest5s{}ttest6s } -spam {ttest7tscripts{1 -1 {} 2m 0}t3s-test2s-test3s {abc def}s-test4s{"abc"}s-test5s\{\}s-test6s \}\ -spam\ \{s-test7uαβγuáu-αβγu-ásone twotthreetoptions{one two} threes-optionsone twos{one two} threetones{} ones one} {twosone\}\ \{two threes"one"ttwos {"one"} twos{one}s \{one\} twotignoretb(iiRi(sone twoR'(sone twoR'(RR)(s one} {twoR'(s"one"R*(s{one}R*(uáR,( t assertFalsetttkt_format_optdicttTruetFalsetcopyRRtkeys(RRtoptst orig_optst amount_opts((Rs;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyttest_format_optdictsl&   $      cCsid!d"d#gd6}tj|ƒ}|jt|ƒt|jƒƒd ƒ|j|d$ƒ|jtj|d tƒd%ƒ|jtjigd 6ƒd&ƒid'gd6}tj|ƒ}|j|d(ƒid)gd6}|jtj|ƒd*ƒid+gd6}|jttj|ƒidgddfgd6}|jttj|ƒiddggd6}|jtj|ƒd,ƒxOddt dt ƒfD]5}i|dfgd6}|jtj|ƒd-ƒq’Widd6}|jttj|ƒ|jt tjid.gd6ƒdS(/NR,tcRtdtothervalRtsingletais-as{b c} val d otherval {} singleR%s {{b c} val d otherval {} single}s-2uáuvãlu üñíćódèu-üñíćódèuá vãluthitopts-opts{ } hiis valid valt2tvalues1 valueis{} valuetinvalid(R,R8sval(R9R:(RR;(s-as{b c} val d otherval {} single(s-as {{b c} val d otherval {} single}(s-2R(uáuvãl(u-üñíćódèuá vãl(Rushi(s-opts{ } hi(iis valid val(s-opts1 value(s-opts{} value(sinvalid( R.t_format_mapdictRRR3R0t assertRaisest TypeErrortNoneR1tsett IndexError(RR4RtvalidRAtstateval((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyttest_format_mapdictts4&   c Cs“|jtjdƒdd fƒ|jttjdƒ|jtjdtdƒdd!fƒ|jtjdtdd"ƒdd#fƒ|jtjdtdd$ƒd d%fƒtjdtdd&dd dd ƒ}|j|d d ƒ|jt|dƒdd dd hƒ|jtjdt dd'd ddgƒd(ƒ|jt tjdƒ|jtjdtddƒdd)fƒ|jtjdtddd*ƒdd+fƒ|jtjdtddd,dd ƒdd-fƒ|jtjdt ddddddgfdd ƒd.ƒ|jttjdƒ|jtjdtdƒdd/fƒ|jtjdtddƒdd0fƒ|jtjdt ddƒd1ƒdS(2NtimageRstest RR<s test {} aR,R8s test {a b} ctxtyistest a bis-as-bR9iis{test {a b c} d}s-x {2 3}tvsapisa b s a b {a b} cR>sa b a bs-opts{a b {a b} {1 2}}s-opt xtfroms{a}(((RR<((R<R,R8((R<R,(R<R,R8R9(s{test {a b c} d}s-x {2 3}((R<R,R8((R<R,(s-optRL(s{a b {a b} {1 2}}s-opt x((R,(s{a}R,( t assertTrueR.t_format_elemcreateRERCRGRR1RFR0t ValueError(Rtres((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyttest_format_elemcreates< & "  cCspddd„}ddd„}|jtjgƒddƒtjdgddƒ}|j|tjdgddƒƒ|j|ddƒ|j|ƒ|ƒƒxRtdƒD]D}|j||ƒ||ƒƒ|j|||ƒ|||ƒƒq¬W|jttjd d gƒ|jttjdƒ|jttjdgƒ|jttjd iidd6d 6fgƒdS(Niic Ssttjdidddgd6dididid d 6fgd 6dd 6fgd 6fgd 6fgd |d|ƒdS(NR<iiitotherR,R8R9R>tnicetchildrent somethingtindentt indent_sizei(ii(R.t_format_layoutlist(RYRZ((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pytsampleÛs ;cs_d‡fd†}d|ƒ||ƒ|d|ƒ|d|ƒ|d|ƒ||ƒ|ƒfS(Nics d|ˆS(NR ((tamount(RY(s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pytæssi%sa -other {1 2 3} -children { %sb -children { %sc -something {1 2} -children { %sd -nice opt %s} %s} %s}ii((RYRZtspaces((RYs;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pytsample_expectedås RR<RYitbadtformatR,tnameRW(R<N(R<R(R<R,( RR.R[RERRCRRRDtAttributeError(RR\R`tsmallestR((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyttest_format_layoutlistÚs$  &  cCsÆ|jtjiidd6dd6dd6d6ƒƒ|jtjiidd6d6ƒdƒitd6td6}|jtjii|d6d6ƒƒidgd 6}|jtjii|d6d6ƒƒ|jt tjiid gd6d6ƒ|jtjiid dgd6d6ƒƒiid ddgd6d6}|jtj|ƒdƒ|ddj idd6ƒ|jtj|ƒdƒt dƒt dƒg|dddd<|jtj|ƒdƒdS(Nt configuretmapselement createRctlayoutsttk::style layout name { null }uαβγuáuvãlu üñíćódèRKtstate1tstate2RtthingsAttk::style element create thing image {name {state1 state2} val} iR>sHttk::style element create thing image {name {state1 state2} val} -opt 30iRiÿÿÿÿsLttk::style element create thing image {name {state1 state2} val} -opt {3 2m}(uáuvãl(RjRksval( R-R.t_script_from_settingsRERR0R1RPRCRGtappendR(Rt configdicttmapdictRK((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyttest_script_from_settingss4#  cCsùd}|jtj|tƒidd6dd6ƒ|jtj|ƒidd6dd6ƒ|jtjdƒƒtddƒ}|jtjd|d ffƒidgd6ƒ|jtjtd ƒtd ƒd td ƒgfƒidd d gd6ƒdS(Ns-as{1 2 3}s -somethingtfooR<RXR;R,Rs-paddingt1it3miR(s-as{1 2 3}s -somethingRr(ssingle(R<R,sval(RR.t_dict_from_tcltupleR1R-R R(Rt fakettupletsspec((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyttest_dict_from_tcltuple<scs»‡fd†}td„tdƒDƒƒ}t|Œ}||dd|ƒ||tdƒd|ƒtd„tdƒDƒƒ}t|Œ}||dd|ƒ|d tdƒdd ƒdS( Ncs-ˆjtj||fƒ||fgƒdS(N(RR.t_list_from_statespec(RwR@t res_valuetstates(R(s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyttest_itSs css|]}d|VqdS(sstate%dN((t.0R((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pys WsiRcss|]}d|VqdS(sstate%dN((R}R((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pys \siR<R,R8(R<R,R8(R<R,R8(ttupleRR R(RR|t states_event statespect states_odd((Rs;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyttest_list_from_statespecRs  c Csi|jtjdƒƒ|jtjdƒdifgƒd}|jtj|ƒdidd6fgƒ|jtjdddfƒdigd6fgƒddddd ddd d ff}|jtj|ƒdidd6d id d 6d ifgd6fgd6fgƒ|jttjdƒ|jttjdƒ|jttjdƒ|jttjdƒdS(NRcs-optionR@R(RXs -childrenRWtniceonetotheronetchilds -otheroptt othervaluetotheropttno_minus((sname(snames-optionsvalue((R…(snameRˆ(snameRˆsvalue(s somethings -children(s somethings -childrensvalue(R-R.t_list_from_layouttupleRRCRR(Rt sample_ltupletltuple((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyttest_list_from_layouttuplecs0    $cCsbdd„}idd6}|jtj||ƒdƒidd6}|jtj||ƒ|ƒdS(NcSs|dkrdS||fS(Nstest val(RE(R>R((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pytfunc’s Rstest vali(RERR.t _val_or_dict(RRtoptions((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyttest_val_or_dict‘s    cCs}d d d d gdfdf}x-|D]%\}}|jtj|ƒ|ƒq%Wtjƒdkry|jttjd ƒndS(Nit09i R<uáÚs[]REtasciisá(ii(R‘i (R<R<(uáÚuáÚ(NsNone(RERR.t_convert_stringvaltsystgetdefaultencodingRCtUnicodeDecodeError(Rtteststorigtexpected((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyttest_convert_stringvalžs  ( RRR7RJRTRfRqRxR‚RŒRRš(((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyRs X ) = 7 +   . tTclObjsToPyTestcBs#eZd„Zd„Zd„ZRS(cCseidd6}|jtj|ƒidd6ƒt|dƒ|d<|jtj|ƒidd6ƒdS(NuvälúèR>(RR.t tclobjs_to_pyR(Rtadict((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyt test_unicode­s  cCsîiddddgd6}|jtj|ƒiddddgd6ƒdddg|d<|jtj|ƒidddgd6ƒtddƒd f|d<|jtj|ƒid gd6ƒ|jtjid gd 6ƒid gd 6ƒdS( NiiiiR>txmR<R,uválũèsy zRL(R<R,uválũè(RR.RœR (RR((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyttest_multivalues´s,)cCs+|jtjidd6ƒidd6ƒdS(Ns some textttext(RR.Rœ(R((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyt test_nosplitÂs(RRRžR R¢(((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyR›«s  t__main__(t run_unittest( R”tunittestR.tobjectRR tTestCaseRR›t tests_noguiRttest.test_supportR¤(((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyts     ÿ’