Your IP : 18.118.120.13


Current Path : /lib64/python2.7/lib-tk/test/test_ttk/
Upload File :
Current File : //lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyo

�
zfc@s�ddlZddlZddlZdfd��YZdefd��YZdefd��YZdejfd	��YZd
ejfd��YZ	ee	fZ
ed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.pytwantobjects
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
RttypenameRR(((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
RRRR(((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	�ZRS(
cs
�fd�}�jtji��|tjidd6ddddgd6�idd	6d
d6�|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(trangetlentassertEqualtpoptfail(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(	tassertFalsetttkt_format_optdictRtFalsetcopyRRtkeys(RR!toptst	orig_optstamount_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|�|jttjid.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
ddh�|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 sa 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(NiicSsttjdidddgd6dididid	d
6fgd6dd6fgd6fgd6fgd
|d|�dS(NRDiiitotherR5R@RARFtnicetchildrent	somethingtindenttindent_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<lambda>�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	tjiidgd6d6�|jtjiiddgd6d6��iidddgd6d6}|jtj|�d�|ddj
idd6�|jtj|�d�td�td�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	<genexpr>UsiRcss|]}d|VqdS(sstate%dN((R�R ((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pys	<genexpr>ZsiRDR5R@(RDR5R@(RDR5R@(RRRR(RR�tstates_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	dddd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�(RkR�RH(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.pytfunc�s
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_dict�s		cCs}d
dd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
RR?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
gd6�id
gd6�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
RR�R�R�(((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyR��s		t__main__(trun_unittest(R�tunittestR7RtobjectRRtTestCaseRR�ttests_noguiR
ttest.test_supportR�(((s;/usr/lib64/python2.7/lib-tk/test/test_ttk/test_functions.pyt<module>s

��

?>