Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.9/tkinter/test/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.9/tkinter/test/__pycache__/widget_tests.cpython-39.opt-2.pyc

a

��g�O�@s�ddlZddlZddlmZmZmZmZmZmZddl	Z
dZe�dkrJeZe
Ze�dd�dkrdeZe�ZGdd�de�ZGdd	�d	�ZGd
d�d�ZGdd
�d
�Zdd�Zdd�ZdS)�N)�AbstractTkTest�tcl_version�requires_tcl�get_tk_patchlevel�pixels_conv�
tcl_obj_eqF)����c@s�eZdZee�ZdZdZedd��Z	dd�Z
dejfdd�Z
eddd	�d
d�Zd0dd
�dd�Zdd�Zdd�Zed�dd�Zdd�Zdd�dd�Zdd�Zdd�Zdd �d!d"�Zddd#�d$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�ZdS)1�AbstractWidgetTestNFcCs:z|jWSty4t|j�dd��|_|jYS0dS)N�tk�scaling)Z_scaling�AttributeError�float�root�call)�self�r�5/usr/local/lib/python3.9/tkinter/test/widget_tests.pyrs
zAbstractWidgetTest.scalingcCs<|js|jrtdkr|St|t�r4d�t|j|��St|�S)N�r�� )	�
_stringify�wantobjectsr�
isinstance�tuple�join�map�_str�str)r�valuerrrr$s

zAbstractWidgetTest._strcCs |||�rdS|�|||�dS�N)�assertEqual)r�actual�expected�msg�eqrrr�assertEqual2+s
zAbstractWidgetTest.assertEqual2)r%�convr'cCs�|||<|tur|}|r ||�}|js,|jsJt|t�rBt�|�}nt|�}|durVt}|j	||||d�|j	|�
|�||d�|�|�}|�t
|�d�|j	|d||d�dS)N)r'r	�)�	_sentinelrrrr�tkinterZ_joinr rr(Zcget�	configurer#�len)r�widget�namer!r%r)r'�trrr�
checkParam0s 

zAbstractWidgetTest.checkParamT)�	keep_origcCs�||}|dur|�|�}|�tj��}|||<Wd�n1sD0Y|durh|�t|j�|�|r~|�|||�n|||<|�tj��}|�||i�Wd�n1s�0Y|dur�|�t|j�|�|r�|�|||�n|||<dSr")�formatZassertRaisesr,ZTclErrorr#r �	exceptionr-)rr/r0r!�errmsgr3Zorig�cmrrr�checkInvalidParamDs"
&,z$AbstractWidgetTest.checkInvalidParamcOs$|D]}|j|||fi|��qdSr")r2)rr/r0�values�kwargsr!rrr�checkParamsZszAbstractWidgetTest.checkParamscOsT|j||g|�Ri|��|j||ddd�|j||ddd�|j||ddd�dS)N�zexpected integer but got ""�r6�10pzexpected integer but got "10p"g������	@zexpected integer but got "3.2"�r;r8)rr/r0r9r:rrr�checkIntegerParam^s
�
�
�z$AbstractWidgetTest.checkIntegerParam�r)cOsL|D]}|j|||fd|i|��q|j||ddd�|j||ddd�dS)Nr)r<z)expected floating-point number but got ""r=�spamz-expected floating-point number but got "spam"�r2r8)rr/r0r)r9r:r!rrr�checkFloatParamgs
�
�z"AbstractWidgetTest.checkFloatParamcCs`dD]}|j|||dd�qdD]}|j|||dd�q |j||ddd�|j||d	d
d�dS)N)FrZfalse�noZoffr)r%)T��trueZyesZonrFr<z!expected boolean value but got ""r=rBz%expected boolean value but got "spam"rC)rr/r0r!rrr�checkBooleanParamos
�
�z$AbstractWidgetTest.checkBooleanParam)�allow_emptyc
Ks>|j||ddddddddd	d
fi|��|j||ddd
�dS)Nz#ff0000z#00ff00z#0000ffz#123456ZredZgreenZblueZwhiteZblackZgreyrBzunknown color name "spam"r=r?)rr/r0rIr:rrr�checkColorParamys��
�z"AbstractWidgetTest.checkColorParamcKsH|j||ddddfi|��tdkr2|�||d�|j||ddd	�dS)
NZarrowZwatchZcrossr<)rr	�nonerBzbad cursor spec "spam"r=)r;rr2r8)rr/r0r:rrr�checkCursorParam�s
�z#AbstractWidgetTest.checkCursorParamcCs0dd�}|||<|�||�|�||d�dS)NcWsdSr"r)�argsrrr�command�sz5AbstractWidgetTest.checkCommandParam.<locals>.commandr<)Z
assertTruer;)rr/r0rNrrr�checkCommandParam�sz$AbstractWidgetTest.checkCommandParamr=cOs�|j||g|�Ri|��|durrd|d�|dd��t|�dkrFdnd|df}|j||dd|d�d	|}|j||d
|d�dS)Nz %s "{}": must be %s%s or %sz, �����,r<Z	ambiguousr=ZbadrB)r;rr.r8)rr/r0r6r9r:Zerrmsg2rrr�checkEnumParam�s�
�z!AbstractWidgetTest.checkEnumParam)r)r3c
Os�|dur|j}|D]P}t}|}	t|t�rF|	rF|	turFt|�|j}t}	|j|||f||	d�|��q|j||dd|d�|j||dd|d�dS)N�r%r)Z6xzbad screen distance "6x")r6r3rBzbad screen distance "spam")	�_conv_pixelsr+rr rr�roundr2r8)
rr/r0r)r3r9r:r!r%Zconv1rrr�checkPixelsParam�s(
��
�
�z#AbstractWidgetTest.checkPixelsParamc
Cs>|�||dddddd�d}tdkr(d}|j||d	|d
�dS)NZflatZgrooveZraisedZridgeZsolidZsunkenzHbad relief "spam": must be flat, groove, raised, ridge, solid, or sunkenrrBr=)r;rr8)rr/r0r6rrr�checkReliefParam�s�
�z#AbstractWidgetTest.checkReliefParamcCs@tj|jdd�}|j|||td�|j||ddd�d||<dS)NZimage1)Zmasterr0rArBzimage "spam" doesn't existr=r<)r,Z
PhotoImagerr2r r8)rr/r0�imagerrr�checkImageParam�s
�z"AbstractWidgetTest.checkImageParamcCs|j|||td�dS)NrA)r2r )rr/r0�varrrr�checkVariableParam�sz%AbstractWidgetTest.checkVariableParamcCs^|�|�|�|t�t|�dkr2|�d|f�|D]"}t|t�s6|�d|f�qZq6dS)Nr*zInvalid bounding box: %r)ZassertIsNotNoneZassertIsInstancerr.Zfailr�int)rZbbox�itemrrr�assertIsBoundingBox�s

z&AbstractWidgetTest.assertIsBoundingBoxcCs�|��}|��}|�t|�t|����|D]}||q,tjjr�dddddd�}t|�}t|j	�}t||�D]8}||vr�|||vr�|||vspt
d|jj|f�qpdS)N�borderwidth�
background�
foregroundZinvalidcommandZvalidatecommand)�bd�bg�fgZinvcmdZvcmdz%s.OPTIONS doesn't contain "%s")
�create�keysr#�sortedr-�test�support�verbose�set�OPTIONS�print�	__class__�__name__)rr/rg�k�aliasesr%rrr�	test_keys�s.
�

�
�
�zAbstractWidgetTest.test_keys)N) rp�
__module__�__qualname__�staticmethod�pixels_roundrU�_conv_pad_pixelsr�propertyrr�object�__eq__r(r+r2r8r;r@rrDrHrJrLrOrSrWrXrZr\r_rsrrrrrs8
��	
�
rc@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�Z d<d=�Z!d>d?�Z"d@dA�Z#dBdC�Z$dDdE�Z%dFdG�Z&dHdI�Z'dJdK�Z(dLdM�Z)dNdO�Z*dPdQ�Z+dRdS�Z,dTdU�Z-dVdW�Z.dXdY�Z/dZd[�Z0d\d]�Z1d^d_�Z2d`da�Z3dbdc�Z4e5ddde�dfdg��Z6e5ddde�dhdi��Z7djdk�Z8dlS)m�StandardOptionsTests)*�activebackground�activeborderwidth�activeforeground�anchorra�bitmapr`�compound�cursor�disabledforeground�exportselection�fontrb�highlightbackground�highlightcolor�highlightthicknessrY�insertbackground�insertborderwidth�
insertofftime�insertontime�insertwidth�jump�justify�orient�padx�pady�relief�repeatdelay�repeatinterval�selectbackground�selectborderwidth�selectforeground�setgrid�	takefocus�text�textvariable�troughcolor�	underline�
wraplength�xscrollcommand�yscrollcommandcCs|��}|�|d�dS)Nr}�rfrJ�rr/rrr�test_configure_activebackground�sz4StandardOptionsTests.test_configure_activebackgroundc
Cs$|��}|�|ddddddd�dS)Nr~r��������?g333333@r���r>�rfrWr�rrr� test_configure_activeborderwidth�s�z5StandardOptionsTests.test_configure_activeborderwidthcCs|��}|�|d�dS)Nrr�r�rrr�test_configure_activeforeground�sz4StandardOptionsTests.test_configure_activeforegroundc
Cs*|��}|�|ddddddddd	d
�dS)Nr��n�ne�eZse�s�sw�wZnw�center�rfrSr�rrr�test_configure_anchors�z*StandardOptionsTests.test_configure_anchorcCs.|��}|�|d�d|jvr*|�|d�dS)Nrard�rfrJrmr�rrr�test_configure_backgrounds
z.StandardOptionsTests.test_configure_backgroundcCs~|��}|�|dd�|�|dd�tjjddd�}|�|dd|�d|jj�d	d
�vrhd|j��vsz|j	|ddd
d�dS)Nr�Z	questheadZgray50z
python.xbmZ
imghdrdata)Zsubdir�@Zaquar
ZwindowingsystemZAppKitrBzbitmap "spam" not definedr=)
rfr2rirjZfindfilerr
rZwinfo_serverr8)rr/�filenamerrr�test_configure_bitmap
s�
�z*StandardOptionsTests.test_configure_bitmapc
CsF|��}|�|ddddddd�d|jvrB|�|ddddddd�dS)	Nr`rr��������@rr�r>rc)rfrWrmr�rrr�test_configure_borderwidths�
z/StandardOptionsTests.test_configure_borderwidthc
Cs$|��}|�|ddddddd�dS)Nr�Zbottomr��leftrK�right�topr�r�rrr�test_configure_compound!s�z,StandardOptionsTests.test_configure_compoundcCs|��}|�|d�dS)Nr�)rfrLr�rrr�test_configure_cursor&sz*StandardOptionsTests.test_configure_cursorcCs|��}|�|d�dS)Nr�r�r�rrr�!test_configure_disabledforeground*sz6StandardOptionsTests.test_configure_disabledforegroundcCs|��}|�|d�dS)Nr��rfrHr�rrr�test_configure_exportselection.sz3StandardOptionsTests.test_configure_exportselectioncCs,|��}|�|dd�|j|dddd�dS)Nr�z3-Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*r<zfont "" doesn't existr=)rfr2r8r�rrr�test_configure_font2s�
�z(StandardOptionsTests.test_configure_fontcCs.|��}|�|d�d|jvr*|�|d�dS)Nrbrer�r�rrr�test_configure_foreground9s
z.StandardOptionsTests.test_configure_foregroundcCs|��}|�|d�dS)Nr�r�r�rrr�"test_configure_highlightbackground?sz7StandardOptionsTests.test_configure_highlightbackgroundcCs|��}|�|d�dS)Nr�r�r�rrr�test_configure_highlightcolorCsz2StandardOptionsTests.test_configure_highlightcolorc	Cs8|��}|�|dddddd�|j|ddd|jd�dS)	Nr�rr�r�rr>r�rT)rfrWr2rUr�rrr�!test_configure_highlightthicknessGs
��z6StandardOptionsTests.test_configure_highlightthicknesscCs|��}|�|d�dS)NrY�rfrZr�rrr�test_configure_imageNsz)StandardOptionsTests.test_configure_imagecCs|��}|�|d�dS)Nr�r�r�rrr�test_configure_insertbackgroundRsz4StandardOptionsTests.test_configure_insertbackgroundc
Cs$|��}|�|ddddddd�dS)Nr�rr�r�rr�r>r�r�rrr� test_configure_insertborderwidthVs�z5StandardOptionsTests.test_configure_insertborderwidthcCs|��}|�|dd�dS)Nr��d�rfr@r�rrr�test_configure_insertofftime[sz1StandardOptionsTests.test_configure_insertofftimecCs|��}|�|dd�dS)Nr�r�r�r�rrr�test_configure_insertontime_sz0StandardOptionsTests.test_configure_insertontimecCs |��}|�|ddddd�dS)Nr�r�r�r�r>r�r�rrr�test_configure_insertwidthcsz/StandardOptionsTests.test_configure_insertwidthcCs|��}|�|d�dS)Nr�r�r�rrr�test_configure_jumpgsz(StandardOptionsTests.test_configure_jumpcCs4|��}|j|dddddd�|j|dddd�dS)	Nr�r�r�r�z6bad justification "{}": must be left, right, or centerr=r<z:ambiguous justification "": must be left, right, or center)rfrSr8r�rrr�test_configure_justifyks�
�z+StandardOptionsTests.test_configure_justifycCs2|��}|�t|d�|j�|�|ddd�dS)Nr�Z
horizontalZvertical)rfr#r Zdefault_orientrSr�rrr�test_configure_orienttsz*StandardOptionsTests.test_configure_orientc
Cs(|��}|j|dddddd|jd�dS)Nr�r皙����@�ffffff@r��12mrA�rfrWrxr�rrr�test_configure_padxys�z(StandardOptionsTests.test_configure_padxc
Cs(|��}|j|dddddd|jd�dS)Nr�rr�r�r�r�rAr�r�rrr�test_configure_pady~s�z(StandardOptionsTests.test_configure_padycCs|��}|�|d�dS)Nr��rfrXr�rrr�test_configure_relief�sz*StandardOptionsTests.test_configure_reliefcCs|��}|�|ddd�dS)Nr�������r�r�rrr�test_configure_repeatdelay�sz/StandardOptionsTests.test_configure_repeatdelaycCs|��}|�|ddd�dS)Nr�r�r�r�r�rrr�test_configure_repeatinterval�sz2StandardOptionsTests.test_configure_repeatintervalcCs|��}|�|d�dS)Nr�r�r�rrr�test_configure_selectbackground�sz4StandardOptionsTests.test_configure_selectbackgroundcCs |��}|�|ddddd�dS)Nr�r�r�r�r>r�r�rrr� test_configure_selectborderwidth�sz5StandardOptionsTests.test_configure_selectborderwidthcCs|��}|�|d�dS)Nr�r�r�rrr�test_configure_selectforeground�sz4StandardOptionsTests.test_configure_selectforegroundcCs|��}|�|d�dS)Nr�r�r�rrr�test_configure_setgrid�sz+StandardOptionsTests.test_configure_setgridcCs|��}|�|dddd�dS)N�stateZactive�disabledZnormalr�r�rrr�test_configure_state�sz)StandardOptionsTests.test_configure_statecCs|��}|�|dddd�dS)Nr��0�1r<�rfr;r�rrr�test_configure_takefocus�sz-StandardOptionsTests.test_configure_takefocuscCs|��}|�|ddd�dS)Nr�r<z
any stringr�r�rrr�test_configure_text�sz(StandardOptionsTests.test_configure_textcCs&|��}t�|j�}|�|d|�dS)Nr�)rfr,Z	StringVarrr\�rr/r[rrr�test_configure_textvariable�sz0StandardOptionsTests.test_configure_textvariablecCs|��}|�|d�dS)Nr�r�r�rrr�test_configure_troughcolor�sz/StandardOptionsTests.test_configure_troughcolorcCs|��}|�|dddd�dS)Nr�rrF�
r�r�rrr�test_configure_underline�sz-StandardOptionsTests.test_configure_underlinecCs|��}|�|dd�dS)Nr�r�r�r�rrr�test_configure_wraplength�sz.StandardOptionsTests.test_configure_wraplengthcCs|��}|�|d�dS)Nr��rfrOr�rrr�test_configure_xscrollcommand�sz2StandardOptionsTests.test_configure_xscrollcommandcCs|��}|�|d�dS)Nr�r�r�rrr�test_configure_yscrollcommand�sz2StandardOptionsTests.test_configure_yscrollcommandcCs|��}|�|d�dS)NrNr�r�rrr�test_configure_command�sz+StandardOptionsTests.test_configure_commandcCs|��}|�|d�dS)NZindicatoronr�r�rrr�test_configure_indicatoron�sz/StandardOptionsTests.test_configure_indicatoroncCs|��}|�|d�dS)NZ	offreliefr�r�rrr�test_configure_offrelief�sz-StandardOptionsTests.test_configure_offreliefcCs|��}|�|d�dS)NZ
overreliefr�r�rrr�test_configure_overrelief�sz.StandardOptionsTests.test_configure_overreliefcCs|��}|�|d�dS)NZselectcolorr�r�rrr�test_configure_selectcolor�sz/StandardOptionsTests.test_configure_selectcolorcCs|��}|�|d�dS)NZselectimager�r�rrr�test_configure_selectimage�sz/StandardOptionsTests.test_configure_selectimagerr	cCs|��}|�|d�dS)NZ
tristateimager�r�rrr�test_configure_tristateimage�sz1StandardOptionsTests.test_configure_tristateimagecCs|��}|�|dd�dS)NZ
tristatevalueZ
unknowable)rfr2r�rrr�test_configure_tristatevalue�sz1StandardOptionsTests.test_configure_tristatevaluecCs&|��}t�|j�}|�|d|�dS)N�variable)rfr,Z	DoubleVarrr\r�rrr�test_configure_variable�sz,StandardOptionsTests.test_configure_variableN)9rprtruZSTANDARD_OPTIONSr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�r�r�rrrrr|�sn
	

r|c@seZdZdd�Zdd�ZdS)�IntegerSizeTestscCs|��}|�|dddd�dS)N�heightr����rr�r�rrr�test_configure_height�sz&IntegerSizeTests.test_configure_heightcCs|��}|�|dddd�dS)N�width��n���rr�r�rrr�test_configure_width�sz%IntegerSizeTests.test_configure_widthN�rprtrurrrrrrr��sr�c@seZdZdd�Zdd�ZdS)�PixelSizeTestsc
Cs$|��}|�|ddddddd�dS)Nrr�g�����LY@gfffff�Y@rrZ3cr�r�rrrr�sz$PixelSizeTests.test_configure_heightc
Cs$|��}|�|ddddddd�dS)Nrrgfffff6y@g�����Iy@rrZ5ir�r�rrrr�sz#PixelSizeTests.test_configure_widthNrrrrrr�srcs�fdd�}|S)Ncsn�jD]b}d|}t�|�s�D]$}t||�r t�|t||��qq |f�fdd�	}||_t�||�q�S)NZtest_configure_cs&|��}||td|�jf��dS)NzOption "%s" is not tested in %s)rf�AssertionErrorrp)r�optionr/��clsrrris
�z5add_standard_options.<locals>.decorator.<locals>.test)rm�hasattr�setattr�getattrrp)rr
Z
methodnameZsource_classri��source_classesrr�	decorators


�z'add_standard_options.<locals>.decoratorr)rrrrr�add_standard_optionssrcCs&tjjr"t��}td|�dd��dS)Nzpatchlevel =�infoZ
patchlevel)rirjrkr,ZTclrnr)Ztclrrr�setUpModulesr)Zunittestr,Ztkinter.test.supportrrrrrrZtest.supportriZnoconvr rVrwr]rzr+rr|r�rrrrrrr�<module>s& 
P




Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists