ó zfc@sÎddlZddlZddlZdfd„ƒYZdefd„ƒYZdefd„ƒYZdejfd „ƒYZd ejfd „ƒYZ ee fZ e d krÊdd l m Z e e ŒndS(iÿÿÿÿNt MockTkAppcBseZd„Zd„ZRS(cCs t|tƒr|S|jdƒS(Nt:(t isinstancettupletsplit(tselftarg((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyt splitlistscCstS(N(tTrue(R((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyt wantobjects s(t__name__t __module__RR (((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyRs t MockTclObjcBs eZdZd„Zd„ZRS(ttestcCs ||_dS(N(tval(RR((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(R R ttypenameRR(((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyR s 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.pyR!s(R R RRR(((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyRs 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_against(s)tbluetfgiiiitpaddings-fgs1 2 3 4s-paddingtiR s1 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(iiR%i(sone twoR0(sone twoR0(R%R2(s one} {twoR0(s"one"R3(s{one}R3(uáR5( t assertFalsetttkt_format_optdictRtFalsetcopyRRtkeys(RR!toptst orig_optst amount_opts((Rs;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyttest_format_optdict'sl&   $      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(/NR5tcRtdtothervalR%tsingletais-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(R5R@R(RARB(R%RC(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(R%uRE(s-opts{ } hi(iis valid val(s-opts1 value(s-opts{} value(RI( R7t_format_mapdictRRR;Rt assertRaisest TypeErrortNoneR9tsett IndexError(RR<RtvalidRItstateval((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyttest_format_mapdicts4&   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(2NtimageR stest R%RDs test {} aR5R@s test {a b} ctxtyistest a bis-as-bRAiis{test {a b c} d}s-x {2 3}tvsapisa b s a b {a b} cRFsa b a bs-opts{a b {a b} {1 2}}s-opt xtfroms{a}(((R%RD((RDR5R@((RDR5(RDR5R@RA(s{test {a b c} d}s-x {2 3}((RDR5R@((RDR5(s-optRT(s{a b {a b} {1 2}}s-opt x((R5(s{a}R5( t assertTrueR7t_format_elemcreateRMRKRORR9RNRt ValueError(Rtres((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyttest_format_elemcreate¨s< & "  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(NRDiiitotherR5R@RARFtnicetchildrent somethingtindentt indent_sizei(ii(R7t_format_layoutlist(RaRb((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(Ra(s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pytñR%si%sa -other {1 2 3} -children { %sb -children { %sc -something {1 2} -children { %sd -nice opt %s} %s} %s}ii((RaRbtspaces((Ras;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pytsample_expectedðs R%RDRaitbadtformatR5tnameR_(RDN(RDR%(RDR5( RR7RcRMRRKRZRLtAttributeError(RRdRhtsmallestR ((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 createRktlayoutsttk::style layout name { null }uαβγuáuvãlu üñíćódèRStstate1tstate2RtthingsAttk::style element create thing image {name {state1 state2} val} iRFsHttk::style element create thing image {name {state1 state2} val} -opt 30iR'iÿÿÿÿsLttk::style element create thing image {name {state1 state2} val} -opt {3 2m}(uáuvãl(RrRsR( R6R7t_script_from_settingsRMRRR9RXRKROtappendR (Rt configdicttmapdictRS((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyttest_script_from_settingss4#  cCsf|jtjtddƒdfƒdgƒ|jtjtdƒdtdƒgƒdddgƒdS( NRDR5Rt1it3mi(RDR5R(RR7t _tclobj_to_pyRR (R((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyttest_tclobj_to_pyGs  !cs»‡fd†}td„tdƒDƒƒ}t|Œ}||dd|ƒ||tdƒd|ƒtd„tdƒDƒƒ}t|Œ}||dd|ƒ|d tdƒdd ƒdS( Ncs-ˆjtj||fƒ||fgƒdS(N(RR7t_list_from_statespec(tsspecRHt res_valuetstates(R(s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyttest_itQs css|]}d|VqdS(sstate%dN((t.0R ((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pys UsiRcss|]}d|VqdS(sstate%dN((RƒR ((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pys ZsiRDR5R@(RDR5R@(RDR5R@(RRRR (RR‚t states_event statespect states_odd((Rs;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyttest_list_from_statespecPs  c Csttƒ}|jtj|dƒƒ|jtj|dƒdifgƒd}|jtj||ƒdidd6fgƒ|jtj|dddfƒdigd6fgƒddddd ddd d ff}|jtj||ƒdidd6d id d 6d ifgd6fgd6fgƒ|jttj|dƒ|jttj|dƒ|jttj|dƒdS(NRks-optionRHR1R`s -childrenR_tniceonetotheronetchilds -otheroptt othervaluetotheropttno_minus((Rk(Rks-optionRH((RŠ(RkR(RkRRH(R`s -children(RR6R7t_list_from_layouttupleRRKRZ(Rttkt sample_ltupletltuple((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyttest_list_from_layouttupleas.    $cCsÄddd„}tƒ}||_|jtj|idƒidd6ƒ|jtj|id ƒidd6ƒ|jtj|idd6dƒdƒ|jtj|idd6dƒidd6ƒdS( NcSs*|dkr|S|dkr dS||fS(Nstest val(RM(R[RFR((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pytfuncs   s-test:3R/R s-testisx:ystest val(s-testi(RMRtcallRR7t _val_or_dict(RR“R((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyttest_val_or_dicts  cCs}d d d d gdfdf}x-|D]%\}}|jtj|ƒ|ƒq%Wtjƒdkry|jttjd ƒndS(Nit09i RDuáÚs[]RMtasciisá(ii(R—i (RDRD(uáÚuáÚ(NRM(RMRR7t_convert_stringvaltsystgetdefaultencodingRKtUnicodeDecodeError(Rtteststorigtexpected((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyttest_convert_stringval¦s  ( R R R?RRR\RnRyR}R‡R’R–R (((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyR%s X ) = 7 +  . tTclObjsToPyTestcBs#eZd„Zd„Zd„ZRS(cCseidd6}|jtj|ƒidd6ƒt|dƒ|d<|jtj|ƒidd6ƒdS(NuvälúèRF(RR7t 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( NiiiiRFtxmRDR5uválũèsy zRT(RDR5uválũè(RR7R¢R(RR£((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyttest_multivalues¼s,)cCs+|jtjidd6ƒidd6ƒdS(Ns some textttext(RR7R¢(R((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyt test_nosplitÊs(R R R¤R¦R¨(((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyR¡³s  t__main__(t run_unittest(RštunittestR7RtobjectR RtTestCaseRR¡t tests_noguiR ttest.test_supportRª(((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyts      ÿ