HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.10/tkinter/test/test_tkinter/__pycache__/test_widgets.cpython-310.opt-1.pyc
o

�i��@sddlZddlZddlmZddlZddlmZddlmZmZm	Z	m
Z
mZddlm
Z
mZmZmZmZmZmZmZed�dd�ZGd	d
�d
ee�Ze
e�Gdd�deej��Ze
e�Gd
d�deej��Ze
e�Gdd�deej��ZGdd�dee�Ze
e�Gdd�deej��Ze
e�Gdd�deej��Ze
e�Gdd�deej��Ze
e�Gdd�deej��Ze
e�Gdd�deej��Z Gdd�de ej�Z!e
ee�Gdd �d eej��Z"e
e�Gd!d"�d"e"ej��Z#e
e�Gd#d$�d$eej��Z$e
ee�Gd%d&�d&eej��Z%e
ee�Gd'd(�d(eej��Z&e
ee�Gd)d*�d*eej��Z'e
ee�Gd+d,�d,eej��Z(e
e�Gd-d.�d.eej��Z)e
e�Gd/d0�d0eej��Z*e
ee�Gd1d2�d2eej��Z+Gd3d4�d4eej�Z,ee%ee"eeee&e e*e+e!e)ee'e(e#e$ee,fZ-e.d5k�r�e�/�dSdS)6�N)�TclError)�requires)�tcl_version�requires_tcl�get_tk_patchlevel�	widget_eq�AbstractDefaultRootTest)�add_standard_options�noconv�pixels_round�AbstractWidgetTest�StandardOptionsTests�IntegerSizeTests�PixelSizeTests�setUpModuleZguicCstt|��S�N)�float�round��x�r�C/usr/local/lib/python3.10/tkinter/test/test_tkinter/test_widgets.py�float_roundsrc@s0eZdZeZdd�Zdd�Zdd�Zdd�Zd	S)
�AbstractToplevelTestcCsR|��}|�|d|jj���|j|dddd�|jdd�}|�|dd�dS)N�classZFooz2can't modify -class option after widget is created��errmsg)�class_)�create�assertEqual�	__class__�__name__�title�checkInvalidParam��self�widget�widget2rrr�test_configure_classs

�
�z)AbstractToplevelTest.test_configure_classcC�J|��}|�|dd�|j|dddd�|jdd�}|�|dd�dS)N�colormap��newz5can't modify -colormap option after widget is createdr)r*�rrr#r$rrr�test_configure_colormap"�
�z,AbstractToplevelTest.test_configure_colormapcCsd|��}|�|d|jrdnd�|j|dddd�|jdd�}|�|d|jr-d�dSd	�dS)
N�	containerr�0�z6can't modify -container option after widget is createdrT�r0�1)rr�wantobjectsr#r$rrr�test_configure_container*s
�$z-AbstractToplevelTest.test_configure_containercCr))N�visualr+�defaultz3can't modify -visual option after widget is createdr)r7r-r$rrr�test_configure_visual2r/z*AbstractToplevelTest.test_configure_visualN)	r!�
__module__�__qualname__r
�_conv_pad_pixelsr(r.r6r9rrrrrs	rc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�ToplevelTest)�
background�borderwidthrr*r0�cursor�height�highlightbackground�highlightcolor�highlightthickness�menu�padx�pady�relief�screen�	takefocus�user7�widthcK�tj|jfi|��Sr)�tkinterZToplevel�root�r%�kwargsrrrrE�zToplevelTest.createcCs8|��}t�|j�}|j|d|td�|�|dd�dS)NrE��eqr+)rrN�MenurO�
checkParamr�r%r&rErrr�test_configure_menuHsz ToplevelTest.test_configure_menucCsv|��}|�|dd�ztjd}Wnty!|�d�Ynw|j|d|dd�|j|d�}|�|d|�dS)NrIr+ZDISPLAYzNo $DISPLAY set.z3can't modify -screen option after widget is createdr)rI)rr�os�environ�KeyErrorZskipTestr#)r%r&Zdisplayr'rrr�test_configure_screenNs�
�z"ToplevelTest.test_configure_screencCs~|��}|�|dd�|jdd�}t|���}|j|d��|j|d�}|�|d|�Wd�dS1s8wYdS)NrKr+Tr3)�wid)rK)rr�hexZwinfo_idZsubTest)r%r&�parentr]r'rrr�test_configure_useZs"�zToplevelTest.test_configure_useN)r!r:r;�OPTIONSrrXr\r`rrrrr=;sr=c@�eZdZdZdd�ZdS)�	FrameTest)r>r?rr*r0r@rArBrCrDrFrGrHrJr7rLcKrMr)rN�FramerOrPrrrrmrRzFrameTest.createN�r!r:r;rarrrrrrcdsrcc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�LabelFrameTest)r>r?rr*r0r@�font�
foregroundrArBrCrD�labelanchor�labelwidgetrFrGrHrJ�textr7rLcKrMr)rNZ
LabelFramerOrPrrrr|rRzLabelFrameTest.createcCs>|��}|�|ddddddddd	d
ddd
�|�|dd�dS)Nri�e�en�es�n�ne�nw�s�se�sw�wZwn�ws�center)r�checkEnumParamr#�r%r&rrr�test_configure_labelanchors�z)LabelFrameTest.test_configure_labelanchorcCs8|��}tj|jddd�}|j|d|dd�|��dS)NZMupp�foo)rk�namerjz.foo��expected)rrN�LabelrOrV�destroy)r%r&�labelrrr�test_configure_labelwidget�sz)LabelFrameTest.test_configure_labelwidgetN)r!r:r;rarrzr�rrrrrfqs
	rfc@seZdZeZdd�ZdS)�AbstractLabelTestc
C�$|��}|�|ddddddd�dS)NrDr��������?�������@�����10p�r�checkPixelsParamryrrr�!test_configure_highlightthickness���z3AbstractLabelTest.test_configure_highlightthicknessN)r!r:r;r
�_conv_pixelsr�rrrrr��sr�c@rb)�	LabelTest)�activebackground�activeforeground�anchorr>�bitmapr?�compoundr@�disabledforegroundrgrhrArBrCrD�image�justifyrFrGrH�staterJrk�textvariable�	underlinerL�
wraplengthcKrMr)rNrrOrPrrrr�rRzLabelTest.createNrerrrrr��s
r�c@� eZdZdZdd�Zdd�ZdS)�
ButtonTest) r�r�r�r>r�r?�commandr�r@r8r�rgrhrArBrCrDr�r��
overreliefrFrGrH�repeatdelay�repeatintervalr�rJrkr�r�rLr�cKrMr)rN�ButtonrOrPrrrr�rRzButtonTest.createcC�|��}|�|dddd�dS)Nr8Zactive�disabled�normal�rrxryrrr�test_configure_default��z!ButtonTest.test_configure_defaultN)r!r:r;rarr�rrrrr��sr�c@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�CheckbuttonTest)&r�r�r�r>r�r?r�r�r@r�rgrhrArBrCrDr��indicatoronr��	offrelief�offvalue�onvaluer�rFrGrH�selectcolor�selectimager�rJrkr��
tristateimage�
tristatevaluer��variablerLr�cKrMr)rN�CheckbuttonrOrPrrrr�rRzCheckbuttonTest.createcC� |��}|�|ddddd�dS)Nr�r2�ffffff@r+�
any string�r�checkParamsryrrr�test_configure_offvalue��z'CheckbuttonTest.test_configure_offvaluecCr�)Nr�r2r�r+r�r�ryrrr�test_configure_onvalue�r�z&CheckbuttonTest.test_configure_onvaluecCs�g}g}td�D]&}t�|j�}|��|�|�dD]}tj||d�}|��|�|�qqdd�|D�}|�tt	|��d|�dS)N�ZAB)rkcSsg|]}t|d��qS�r�)�str)�.0�brrr�
<listcomp>�sz9CheckbuttonTest.test_unique_variables.<locals>.<listcomp>�)
�rangerNrdrO�pack�appendr�r�len�set)r%ZframesZbuttons�i�f�jr�Z	variablesrrr�test_unique_variables�s
�z%CheckbuttonTest.test_unique_variablescCs|t�|j�}t�|j�}tj|ddd�}tj|ddd�}tj|jdd�}|��|�|��d�|��|�|��d�dS)N�testZTest1)r|rkZTest2�r|r2r)	rNrdrOr�ZIntVar�selectr�getZdeselect)r%�f1�f2�b1�b2�vrrr�test_same_name�szCheckbuttonTest.test_same_nameN)	r!r:r;rarr�r�r�r�rrrrr��sr�c@r�)�RadiobuttonTest)%r�r�r�r>r�r?r�r�r@r�rgrhrArBrCrDr�r�r�r�r�rFrGrHr�r�r�rJrkr�r�r�r��valuer�rLr�cKrMr)rNZRadiobuttonrOrPrrrrrRzRadiobuttonTest.createcCr�)Nr�r2r�r+r�r�ryrrr�test_configure_valuer�z$RadiobuttonTest.test_configure_valueN)r!r:r;rarr�rrrrr��s
r�c@s^eZdZdZee�Zdd�Zdd�Zdd�Z	e
jZdd	�Zd
d�Z
dd
�Zdd�Zdd�ZdS)�MenubuttonTest)r�r�r�r>r�r?r�r@�	directionr�rgrhrArBrCrDr�r�r�rErFrGrHr�rJrkr�r�rLr�cKrMr)rNZ
MenubuttonrOrPrrrrrRzMenubuttonTest.createc	C�"|��}|�|dddddd�dS)Nr�ZaboveZbelow�flush�left�rightr�ryrrr�test_configure_direction�
�z'MenubuttonTest.test_configure_directioncC�"|��}|j|ddddtd�dS)NrA�d���r��conv�r�checkIntegerParamr�ryrrr�test_configure_height �z$MenubuttonTest.test_configure_heightcCs�|��}tj|jdd�}|j|d|td�d}|�tj��}d|d<Wd�n1s,wY|dur>|�t|j	�|�|�tj��}|�
ddi�Wd�n1sVwY|durj|�t|j	�|�dSdS)NZimage1)Zmasterr|r�r�zimage "spam" doesn't exist�spam)rrNZ
PhotoImagerOrVr��assertRaisesrr�	exceptionZ	configure)r%r&r�r�cmrrr�test_configure_image's
���z#MenubuttonTest.test_configure_imagecCs4|��}tj|dd�}|j|d|td�|��dS)NrEr�rS)rrNrUrVrr�rWrrrrX5sz"MenubuttonTest.test_configure_menucC�2|��}|�|ddddd�|j|dddd�dS)	NrF�皙����@�ffffff@�12mr�rr}�rr�rVryrrr�test_configure_padx;�z"MenubuttonTest.test_configure_padxcCr�)	NrGr�r�r�r�r�rr}r�ryrrr�test_configure_pady@r�z"MenubuttonTest.test_configure_padycCr�)NrL��n���rr�r�ryrrr�test_configure_widthEr�z#MenubuttonTest.test_configure_widthN)r!r:r;ra�staticmethodrr�rr�r�r
r�r�rXr�r�r�rrrrr�	s�r�c@seZdZddd�Zdd�ZdS)	�OptionMenuTestr���ar��ccKstj|jd|g|�Ri|��Sr)rN�
OptionMenurO)r%r8�valuesrQrrrrLszOptionMenuTest.createcCsF|�td��tj|jdddd�Wd�dS1swYdS)Nz^unknown option -image$r�r+)r�)�assertRaisesRegexrrNrrO�r%rrr�test_bad_kwargOs"�zOptionMenuTest.test_bad_kwargN)r�r�)r!r:r;rrrrrrr�Js
r�c@sheZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)�	EntryTest)r>r?r@�disabledbackgroundr��exportselectionrgrhrBrCrD�insertbackground�insertborderwidth�
insertofftime�insertontime�insertwidth�invalidcommandr��readonlybackgroundrH�selectbackground�selectborderwidth�selectforeground�showr�rJr��validate�validatecommandrL�xscrollcommandcKrMr)rNZEntryrOrPrrrrcrRzEntryTest.createcC�|��}|�|d�dS)Nr�rZcheckColorParamryrrr�!test_configure_disabledbackgroundf�z+EntryTest.test_configure_disabledbackgroundc
Cs:|jdd�}|�|ddddddd	�|j|dd
dd�dS)
Nr�)rr	rr�r�r�r�r��<�2r}r�ryrrr� test_configure_insertborderwidthjs
�z*EntryTest.test_configure_insertborderwidthcCsv|��}|�|dddd�|j|dddd�|j|dddd�td	�d
kr0|j|dd	dd�dS|j|dd	dd�dS)Nrr��������@r�g�������?r�r}r�g�������?rr2)rr�rVrryrrr�test_configure_insertwidthqsz$EntryTest.test_configure_insertwidthcC�$|��}|�|d�|�|d�dS)Nr
Zinvcmd�rZcheckCommandParamryrrr�test_configure_invalidcommand{�z'EntryTest.test_configure_invalidcommandcCr)Nrrryrrr�!test_configure_readonlybackground�rz+EntryTest.test_configure_readonlybackgroundcCs6|��}|�|dd�|�|dd�|�|dd�dS)Nr�*r+� �rrVryrrr�test_configure_show�szEntryTest.test_configure_showcCr�)Nr�r�r��readonlyr�ryrrr�test_configure_state���zEntryTest.test_configure_statec
Cr�)Nr�all�keyZfocusZfocusinZfocusout�noner�ryrrr�test_configure_validate�r�z!EntryTest.test_configure_validatecCr)NrZvcmdr ryrrr�test_configure_validatecommand�r"z(EntryTest.test_configure_validatecommandcCs$|��}|�dd�|�|���|�dd�|�|��d�|�|���|�d�|�	d�|�|��d�|�dd�|�|��d	�|�
�|�|���|�dd�|�d�|�|��d
�|�d�|�|��d�|�d�|�|��d
�|�d�|�|��d�|�d�dS�NrZ12345�endr2r��2r�r��4Z1234Z234�Z2345�r�insertZassertFalseZselection_presentZselection_rangerZ
selection_getZ
assertTrueZselection_fromZselection_to�selection_clearZselection_adjustryrrr�test_selection_methods�s.





z EntryTest.test_selection_methodsN)r!r:r;rarrrrr!r#r'r)r.r/r8rrrrrTs

rc@s�eZdZdZdd�ZdZdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�ZdS)�SpinboxTest),r�r>r?�buttonbackground�buttoncursor�buttondownrelief�buttonupreliefr�r@rr�rrgrh�format�fromrBrCrD�	incrementrr	r
rrr
r�rHrr�r�rrrr�rJr��torrrrL�wraprcKrMr)rNZSpinboxrOrPrrrr�rRzSpinboxTest.createNcCr)Nr:rryrrr�test_configure_buttonbackground�rz+SpinboxTest.test_configure_buttonbackgroundcCr)Nr;�rZcheckCursorParamryrrr�test_configure_buttoncursor�rz'SpinboxTest.test_configure_buttoncursorcCr)Nr<�rZcheckReliefParamryrrr�test_configure_buttondownrelief�rz+SpinboxTest.test_configure_buttondownreliefcCr)Nr=rFryrrr�test_configure_buttonuprelief�rz)SpinboxTest.test_configure_buttonupreliefcCs�|��}|�|dd�|�|dd�|�|dd�|�|dd�|�|dd�|�|dd�|�|dd�|�|dd	�|�|dd
�|�|dd�|�|dd�|�|dd
�dS)Nr>z%2fz%2.2fz%.2fz%2.fz%2e-1fz2.2z%2.-2fz%-2.02fz% 2.02fz	% -2.200fz%09.200fz%d�rrVr#ryrrr�test_configure_format�sz!SpinboxTest.test_configure_formatcC�>|��}|�|dd�|�|dddd�|j|dddd	�dS)
NrAgY@r?����ffffff$@�ffffff'@���*-to value must be greater than -from valuer�rrV�checkFloatParamr#ryrrr�test_configure_from��

�zSpinboxTest.test_configure_fromc	Cr�)Nr@���r2rMg������)@r�rrRryrrr�test_configure_increment�r�z$SpinboxTest.test_configure_incrementcCrK)
Nr?gY�rArLrMrNi8���rPrrQryrrr�test_configure_to�rTzSpinboxTest.test_configure_tocCs\|��}|�|dd�|�|dd�|j|dddd�|j|dddd�|�|dd�dS)Nrr+zmon tue wed thur)ZmonZtueZwedZthurr})�*g��Q�	@r+r�z42 3.14 {} {any string})rrrVryrrr�test_configure_values�s
�
�z!SpinboxTest.test_configure_valuescCr)NrB�rZcheckBooleanParamryrrr�test_configure_wraprzSpinboxTest.test_configure_wrapcCs`|��}|�|�d��|�tj|jd�|�tj|jd�|�t|j�|�t|jdd�dS)Nr�noindexr2)r�assertIsBoundingBox�bboxr�rNr�	TypeErrorryrrr�	test_bboxszSpinboxTest.test_bboxcCs|��}|�dd�|�|���|�dd�|�|��d�|�|���|�d�|�	d�|�|��d�|�dd�|�|��d	�|�
�|�|���|�dd�|�d�|�|��d
�|�d�|�|��d�|�d�|�|��d
�|�d�|�|��d�dSr0r5ryrrrr8s,





z"SpinboxTest.test_selection_methodscCsP|��}|�|��d�|�d�|�|��d�|�d�|�|��d�dS)Nr-ZbuttonupZ
buttondown)rrZselection_elementryrrr�test_selection_element+s

z"SpinboxTest.test_selection_element)r!r:r;rarr'rCrErGrHrJrSrWrXrZr\rar8rbrrrrr9�s"r9c@s�eZdZdZedkrdZdd�Zdd�Zedd	�d
d��Z	edd	�dd
��Z
dd�Zdd�Zedd	�dd��Z
edd�dd��Zdd�Zdd�Zdd�Zdd�Zedd	�dd ��Zd!d"�Zd#d$�Zedd	�d%d&��Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/S)0�TextTest))�autoseparatorsr>�blockcursorr?r@�endlinerrgrhrArBrCrD�inactiveselectbackgroundrr	r
r�insertunfocussedr�maxundorFrGrHrrr�setgrid�spacing1�spacing2�spacing3�	startliner��tabs�tabstylerJ�undorLrBr�yscrollcommand��r4TcKrMr)rNZTextrOrPrrrrFrRzTextTest.createcCr)Nrdr[ryrrr�test_configure_autoseparatorsIrz&TextTest.test_configure_autoseparatorsrtr4cCr)Nrer[ryrrr�test_configure_blockcursorM�z#TextTest.test_configure_blockcursorcC�|��}d�dd�td�D��}|�d|�|j|dddd	�|j|dd
dd	�|j|dddd
�|�|dd�|�|dd�|j|dddd
�dS)N�
cs��|]}dVqdS�zLine %dNr�r�r�rrr�	<genexpr>U��z2TextTest.test_configure_endline.<locals>.<genexpr>r�r1rfrOr+r}rLr��expected integer but got "spam"rrrn��
�1-startline must be less than or equal to -endline�r�joinr�r6rVr#�r%r&rkrrr�test_configure_endlineR�
�

�zTextTest.test_configure_endlinecCsD|��}|�|ddddd�|j|dddd�|j|dd	dd�dS)
NrAr�������LY@�fffff�Y@Z3cr�r2r}rr�ryrrrr�`szTextTest.test_configure_heightcCr�)Nrirr4rU�rr�ryrrr�test_configure_maxundofr�zTextTest.test_configure_maxundocCr)Nrgrryrrr�'test_configure_inactiveselectbackgroundjrwz0TextTest.test_configure_inactiveselectbackgroundr�cCr�)NrhZhollowr-Zsolidr�ryrrr�test_configure_insertunfocussedos�z(TextTest.test_configure_insertunfocussedc
Cs*|��}|j|dddddttdkd�dS)Nrr�r�r�r�rs)r��	keep_orig)rr�r
rryrrr� test_configure_selectborderwidthus


�z)TextTest.test_configure_selectborderwidthcCr�)	Nrk��ffffff5@皙����6@�0.5c���rr}r�ryrrr�test_configure_spacing1{r�z TextTest.test_configure_spacing1cCr�)	Nrlr4皙����@�ffffff@z0.1crUrr}r�ryrrr�test_configure_spacing2�r�z TextTest.test_configure_spacing2cCr�)	Nrmr�r�r�r�rLrr}r�ryrrr�test_configure_spacing3�r�z TextTest.test_configure_spacing3cCrx)Nrycsrzr{rr|rrrr}�r~z4TextTest.test_configure_startline.<locals>.<genexpr>r�r1rnrOr+r}rLr�rrr�rfr�Fr�r�r�rrr�test_configure_startline�r�z!TextTest.test_configure_startlinecCs8|��}tdkr|�|ddd�dS|�|ddd�dS)Nrsr�r�r��rrr�rxryrrrr)�szTextTest.test_configure_statecCst|��}t�dkr|j|dddd�n|�|dd�|j|dddd�|j|dddd�|j|dd	d
tdkd�dS)
N�rtr4�ro)rMg33333�4@�1i�2i)z10.2z20.7r�r�r}z10.2 20.7 1i 2iz2c left 4c 6c center)Z2cr�Z4cZ6crwr�zbad screen distance "spam"rs)rr�)rrrVr#rryrrr�test_configure_tabs�s 

�
�
�

�zTextTest.test_configure_tabscC�|��}|�|ddd�dS)NrpZtabularZ
wordprocessorr�ryrrr�test_configure_tabstyle�sz TextTest.test_configure_tabstylecCr)Nrqr[ryrrr�test_configure_undo�rzTextTest.test_configure_undocCs>|��}|�|dd�|j|dddd�|j|dddd�dS)NrLr�r�r2r}r)rr�rVryrrrr��szTextTest.test_configure_widthcCs<|��}tdkr|�|dddd�dS|�|dddd�dS)NrsrB�charr-Zwordr�ryrrrr\�szTextTest.test_configure_wrapcCsp|��}|�|�d��|�|�d��|�tj|jd�|�tj|jd�|�t|j�|�t|jdd�dS)Nz1.1r1r])rr^r_�assertIsNoner�rNrr`ryrrrra�szTextTest.test_bboxN)r!r:r;rar�
_stringifyrrurrvr�r�r�r�r�r�r�r�r�r�r)r�r�r�r�r\rarrrrrc4s<








rcc@s�eZdZdZeZdZdd�Zdd�Zdd�Z	d	d
�Z
dd�Zd
d�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zedd �d!d"��Zd#S)$�
CanvasTest)r>r?�closeenough�confiner@rArBrCrDrr	r
rr�offsetrH�scrollregionrrrr�rJr�xscrollincrementrr�yscrollincrementrLTcKrMr)rNZCanvasrOrPrrrr�rRzCanvasTest.createc	C�$|��}|j|dddddtd�dS)Nr���333333@r���r�)rrRrryrrr�test_configure_closeenough��
�z%CanvasTest.test_configure_closeenoughcCr)Nr�r[ryrrr�test_configure_confine�rz!CanvasTest.test_configure_confinec
Csd|��}|�|dd�|�|dddddddd	d
d�|�|dd�|�|dd
�|�|dd�dS)Nr�z0,0rorprlrsrrrtrurqrwz10,20z#5,6r�)rrr�rVr#ryrrr�test_configure_offset�s�z CanvasTest.test_configure_offsetcCsv|��}|�|dd�|j|dddd�|�|dd�|j|dddd�|�|dd	�|�|dd
�|�|dd�dS)Nr�z0 0 200 150)rrrO�r}r+r�zbad scrollRegion "spam"r)rrrOr�)rrrO)rrrOr�rrIryrrr�test_configure_scrollregion�s
�
�z&CanvasTest.test_configure_scrollregioncC� |��}|j|ddddd�dS)Nr�r�r�z0bad state value "{}": must be normal or disabledrr�ryrrrr)�
�zCanvasTest.test_configure_statec
Cr�)Nr��(rg������D@g������E@i���z0.5ir�ryrrr�test_configure_xscrollincrementr�z*CanvasTest.test_configure_xscrollincrementc
Cr�)Nr�r�r�ffffff&@g333333+@rLz0.1ir�ryrrr�test_configure_yscrollincrementr�z*CanvasTest.test_configure_yscrollincrementcCs<dD]}||d�}|�|�|d�|�q|jt|dd�dS)N)ZbevelZmiterr)�	joinstyler�r��r�itemcgetr�r)r%r��factoryr�r�rrr�_test_option_joinstyles
z!CanvasTest._test_option_joinstylecCs�dD]}||d�}|�|�|d�d�qdD]}||d�}|�|�|d�d�q|ddd	�}|�|�|d�d�|�|�|d
�d�|ddd	�}|�|�|d�d�|�|�|d
�d�|jt|d
d�dS)N)r2Tr4�trueZyesZon)�smoothr�r�)rFr1Zfalse�noZoffr1T�)r��
splinestepr�Z30�rawr�r�)r%r�r�r�r�rrr�_test_option_smooths

zCanvasTest._test_option_smoothc
Cs~|��}|�dddd�}|�|�|�gd��|�|�|�d�|�gd��}|�|�|�gd��|�|�|�d	�|�d
d�}|�|�|�gd��|�|�|�d
�|�ddg�}|�|�|�gd��|�|�|�d�|�t|jddd�|�t|jgd��|�t|jdddddd�|�t|jgd��|�t|jdd�|�t|jddg�|�t|j�|�t|jg�dS)Nr�r�rr�)�4@�$@�N@�>@)��	�=�)�r�r�r�)�5@�&@��N@�?@)r�r��>� ��r��r��)�6@�(@�O@�@@)r�r��?�!��r��r��
)�7@�*@��O@��@@)r�r��@�"�r�r�rr�r�r�r�r�rrr�)r�create_rectangler�coordsr_r�r�
IndexError)r%r��i1�i2�i3�i4rrr�test_create_rectangle%s*z CanvasTest.test_create_rectanglec	s�|�����dddddd�}|���|�gd��|���|�d�|���|d	�d
�|���|d�d�|���|d
�d�|���|d�d�|���|d�d�|���|d�d���gd��}|���|�gd��|���|�d���ddd�}|���|�gd��|���|�d���gd��}|���|�gd��|���|�d�|�t�jddd�|�t�jgd ��|�t�jdd�|�t�jddg�|�t�j�|�t�jg�d!D]}�jdddd|d"�}|���|d	�|�q�jddddd#gd$�d%�}|���|d�d&�|jt�jddddd'd"�d(D]}�jdddd|d)�}|���|d
�|��q$|jt�jddddd'd)�|�	��fd*d+��|�
��fd,d+��dS)-Nr�r�r�rrr��r�r��D@�I@r�r���rtr��4�arrowr-�
arrowshapez8 10 3�capstyle�buttr�rr�r1r��12�r�r��)�3r�r��r�r�g�D@g�I@r�r�)r�r�r��5r��rYr�r��r�r�gE@gJ@r�r�)r�r�r��6�r�)�+rr��r�r�g�E@g�J@r�r�)r�r��A�7r�)r-�firstZlastZboth)r�r)r�r�r4)r�r�z10 15 5r�)rZ
projectingr)rc��jdi|��S�Nr���create_line�rQ�r�rr�<lambda>l�z-CanvasTest.test_create_line.<locals>.<lambda>cr)N)r�r�rr�rrrrrrnr)rrrr�r_r�r�rr�r�r�)r%r�r�r�r�r�r�rrrr�test_create_line@sR
�
�zCanvasTest.test_create_linecs�|�����dddddd�}|���|�gd��|���|�d�|���|d	�d
�|���|d�d�|���|d
�d���gd��}|���|�gd��|���|�d���ddd�}|���|�gd��|���|�d���gd��}|���|�gd��|���|�d�|�t�jddd�|�t�jgd��|�t�j�|�t�jg�|�	��fdd��|�
��fdd��dS)Nr�r�r�rrr�r�)r�r�r�rr�rr�r1r�rrr)r�r�r�r�r�rr�r	)r�r�r�rrr
)r�r�r�r
r�crr��create_polygonrrrrr�rz0CanvasTest.test_create_polygon.<locals>.<lambda>crrrrrrrr�r)rrrr�r_r�r�rr�r�r�)r%r�r�r�r�rrr�test_create_polygonps4
�
�zCanvasTest.test_create_polygonc	Cs�|��}|jdddddddd�}|�|�|�gd	��|�|�d�gd	��|�|�|�d
�|�|ddddd
d�|�|�|�gd��|�|�|�d�|�|gd��|�|�|�gd��|�|dddd�|�|�|�gd��|�|�|�d�|�t|j|ddd�|�t|j|gd��|�t|j|dd�|�t|j|ddg�|�|dddd�|�|�}|�|t�|�t	|�d�|�|dd�t
d�D]
}|�||t�q�dS)Nr�r�r�rrr�r��tagsr�r�r��P�Z)r�r�g�Q@gT@g�V@r�)�0�&�\�Rrr)r�r�r�r�)r�rtr�r�r�Z20Z30cZ60ir�r�r)rrrr�r_r�r�assertIsInstance�listr�r�r)r%r�r�r�rrr�test_coords�s2
�zCanvasTest.test_coordsrtr�cCsH|��}|jdddddd�}|jdddddd�}|�|�\}}}}|�|�\}}}}|�ddd	�|�|�\}	}
}}|�|�\}}}}|�|	d�|�|
d	�|�||||	�|�||||
�|�||�|jddd
�|�|�\}
}}}|�|�\}}}}|�|d�|�||�|�||	||
�|�||
||�dS)Nr2r��grouprr�rr�rOr�)�y)rr�r_ZmovetorZ	tag_lower)r%r&r�r�Zx1Zy1�_Zx2Zy2Zx1_2Zy1_2Zx2_2Zy2_2Zx1_3Zy1_3Zx2_3Zy2_3rrr�test_moveto�s(zCanvasTest.test_movetoN)r!r:r;rarr�r�rr�r�r�r�r)r�r�r�r�r�rrr'rr+rrrrr��s(
	0r�c@s�eZdZdZdd�Zdd�Zeddd�ej�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%S)&�ListboxTest)�activestyler>r?r@r�rrgrhrArBrCrDr��listvariablerHrrr�
selectmoderjr�rJrLrrrcKrMr)rNZListboxrOrPrrrr�rRzListboxTest.createcCr�)Nr-Zdotboxr-r�r�ryrrr�test_configure_activestyle�r*z&ListboxTest.test_configure_activestylertr�r4cCs&|��}t�|j�}|�|d|�dS)Nr.)rrNZ	DoubleVarrOZcheckVariableParam)r%r&�varrrr�test_configure_listvariable�sz'ListboxTest.test_configure_listvariablecCsD|��}|�|dd�|�|dd�|�|dd�|�|dd�dS)Nr/ZsingleZbrowseZmultipleZextendedr&ryrrr�test_configure_selectmode�s
z%ListboxTest.test_configure_selectmodecCr�)Nr�r�r�r�ryrrrr)��z ListboxTest.test_configure_statecCs�|��}|�td��
|�d�Wd�n1swYd��}|jdg|�R�t|�D]\}}|j||d�q0|�t��|��Wd�n1sPwY|�td��
|�d�Wd�n1skwY|�	|�dd�d	�|�	|�dd�d
�|�	|�dd�d	�|�d�}|�
|t�|��D](\}}|�
t|�d�t|�d
kr�|�	||�d|��|�	|d|�d|��q�dS)Nzitem number "0" out of rangerz)red orange yellow green blue white violetr1)r>zbad listbox index "red"�redr>)r>r>�
Backgroundr+r5)r>r>r6r+Zvioletz@0,0)r�r4r4r�)rrr�
itemconfigure�splitr6�	enumerater�r`rr%�dict�itemsZassertInr�r�)r%r&Zcolorsr�Zcolor�d�kr�rrr�test_itemconfigure�s@�
�����
��zListboxTest.test_itemconfigurecCs�|��}|�ddddd�|jd
i||i��|�|�d|�d|�|�|�d|�|�|�td��|jd
i|d	i��Wd�dS1sIwYdS)Nr1r�r�r�r<rr�zunknown color name "spam"r�)r)rr6r7rr�rr)r%r|r�r&rrr�check_itemconfigures"�zListboxTest.check_itemconfigurecC�|�dd�dS)Nr>�#ff0000�r?rrrr�test_itemconfigure_background�z)ListboxTest.test_itemconfigure_backgroundcCr@)N�bgrArBrrrr�test_itemconfigure_bgrDz!ListboxTest.test_itemconfigure_bgcCr@)NZfg�#110022rBrrrr�test_itemconfigure_fgrDz!ListboxTest.test_itemconfigure_fgcCr@)NrhrGrBrrrr�test_itemconfigure_foregroundrDz)ListboxTest.test_itemconfigure_foregroundcCr@)NrrGrBrrrr�#test_itemconfigure_selectbackgroundrDz/ListboxTest.test_itemconfigure_selectbackgroundcCr@)Nrz#654321rBrrrr�#test_itemconfigure_selectforeground rDz/ListboxTest.test_itemconfigure_selectforegroundcCs�|��}|jdgdd�td�D��R�|��|�|�d��|�|�d��|�|�d��|�t|jd�|�t|jd�|�t	|j�|�t	|jdd�dS)	Nrcs��|]}d|VqdS�zel%dNrr|rrrr}%��z'ListboxTest.test_box.<locals>.<genexpr>rtrUr�r]r2)
rr6r�r�r^r_r�r�rr`�r%Zlbrrr�test_box#s zListboxTest.test_boxcCsp|��}|jdgdd�td�D��R�|�dtj�|�dd�|�d�|�|��d�|�	t
|jd�dS)	NrcsrLrMrr|rrrr}1rNz0ListboxTest.test_curselection.<locals>.<genexpr>rtr�r�r�)r�r�r�r�)rr6r�r7rNZENDZ
selection_setrZcurselectionr�r`rOrrr�test_curselection/s 
zListboxTest.test_curselectioncCs:|��}|jdgdd�td�D��R�|�|�d�d�|�|�d�d�|�|�d�d	�|�|�d�d
�|�|�d�d
�|�|�dd�d
�|�|�dd�d�|�|�dd�d�|�|�dd�d�|�t|jd�|�t|jd�|�t|j�|�t|jdd�|�t|jddd�|�t|jd�dS)NrcsrLrMrr|rrrr}:rNz'ListboxTest.test_get.<locals>.<genexpr>rt�el0r��el3r1�el7r+rUr4)rSZel4�el5)rUZel6rTr)rRr]r2r�r�)rr6r�rr�r�rr`rOrrr�test_get8s" zListboxTest.test_getN)r!r:r;rarr0rr
Ztest_configure_justifyr2r3r)r>r?rCrFrHrIrJrKrPrQrVrrrrr,�s&		r,c@steZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)�	ScaleTest)r�r>�bigincrementr?r�r@�digitsrgrhr?rBrCrDr��length�orientrHr�r��
resolution�	showvalue�sliderlength�sliderreliefr�rJ�tickintervalrA�troughcolorr�rL�verticalcKrMr)rNZScalerOrPrrrrYrRzScaleTest.createcCr�)NrXg������(@g������7@r�rVryrrr�test_configure_bigincrement\r�z%ScaleTest.test_configure_bigincrementcCr�)NrYr4rr�ryrrr�test_configure_digits`r4zScaleTest.test_configure_digitscCs4|��}t�dkrtnt}|j|dddd|d�dS)N)rtr�r�r?r��������-@�333333.@r�)rrrrrR)r%r&r�rrrrSdszScaleTest.test_configure_fromcCs(|��}|�|dd�|�|dd�dS)Nr�r�r+r&ryrrr�test_configure_labeliszScaleTest.test_configure_labelcCr�)NrZ�gffffff`@g33333�`@�5ir�ryrrr�test_configure_lengthnr�zScaleTest.test_configure_lengthcCr�)Nr\g������@rg������@r�rVryrrr�test_configure_resolutionrr�z#ScaleTest.test_configure_resolutioncCr)Nr]r[ryrrr�test_configure_showvaluevrz"ScaleTest.test_configure_showvaluec	Cr�)Nr^r�r��333333/@r�Z3mr�ryrrr�test_configure_sliderlengthzr�z%ScaleTest.test_configure_sliderlengthcCr)Nr_rFryrrr�test_configure_sliderreliefrz%ScaleTest.test_configure_sliderreliefc	Cs8|��}|j|dddddtd�|j|dddtd	�dS)
Nr`r2�333333@r�rr�r�r�)r~r�)rrRrrVryrrr�test_configure_tickinterval�s�
�z%ScaleTest.test_configure_tickintervalc	Cr�)NrAi,rerfrLr�)rrRrryrrrrX�r�zScaleTest.test_configure_toN)r!r:r;ra�default_orientrrcrdrSrgrjrkrlrnrorqrXrrrrrWLs	rWc@sLeZdZdZeZdZdZdd�Zdd�Z	dd	�Z
d
d�Zdd
�Zdd�Z
dS)�
ScrollbarTest)r��activereliefr>r?r�r@�elementborderwidthrBrCrDZjumpr[rHr�r�rJrarLTrbcKrMr)rNZ	ScrollbarrOrPrrrr�rRzScrollbarTest.createcCr)NrtrFryrrr�test_configure_activerelief�rz)ScrollbarTest.test_configure_activereliefcCr�)Nrurpr�r��1mr�ryrrr�!test_configure_elementborderwidth�r�z/ScrollbarTest.test_configure_elementborderwidthcCr�)Nr[rb�
horizontalz4bad orientation "{}": must be vertical or horizontalrr�ryrrr�test_configure_orient�r�z#ScrollbarTest.test_configure_orientcCsZ|��}dD]}|�|�|�|��|�q|�d�|�|���|�t|jdd�dS)N)�arrow1Zslider�arrow2r+r{r|)rZactivaterr�r�r`)r%�sbrlrrr�
test_activate�s

zScrollbarTest.test_activatecCs�|��}|�dd�|�|��d�|�t|jdd�|�t|jdd�|�t|jdd�|�t|jd�|�t|jddd�dS)	N皙�����?皙�����?)rr��abc�defg333333�?gffffff�?g�������?)rr�rr�r�rr`)r%r}rrr�test_set�szScrollbarTest.test_setN)r!r:r;rarr�r�rrrrvrxrzr~r�rrrrrs�s		rsc@s.eZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	e
d
dd�dd��Ze
d
dd�dd��Ze
d
dd�dd��Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd@d'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Ze
d
d�d1d2��Zd3d4�Zd5d6�Zd7d8�Zd9d:�Ze
d
d�d;d<��Z d=d>�Z!d?S)A�PanedWindowTest)r>r?r@�	handlepad�
handlesizerA�opaqueresizer[�proxybackground�proxyborderwidth�proxyreliefrH�
sashcursor�sashpad�
sashrelief�	sashwidth�
showhandlerLrycKrMr)rNZPanedWindowrOrPrrrr�rRzPanedWindowTest.createc	Cr�)Nr�r4r�r�r�rwr�ryrrr�test_configure_handlepad�r�z(PanedWindowTest.test_configure_handlepadc
C�&|��}|j|ddddddtd�dS)Nr�rtg������"@g333333%@r��2mr��rr�r
ryrrr�test_configure_handlesize��
�z)PanedWindowTest.test_configure_handlesizecC�(|��}|j|dddddddtd�	dS)	NrAr�r�r�r�rr�r�r�ryrrrr���
�z%PanedWindowTest.test_configure_heightcCr)Nr�r[ryrrr�test_configure_opaqueresize�rz+PanedWindowTest.test_configure_opaqueresizertr�r4cCr)Nr�rryrrr�test_configure_proxybackground�rwz.PanedWindowTest.test_configure_proxybackgroundcCr�)	Nr�rr�g333333@r�r�r�r�r�ryrrr�test_configure_proxyborderwidth�s

�z/PanedWindowTest.test_configure_proxyborderwidthcCr)Nr�rFryrrr�test_configure_proxyrelief�rwz*PanedWindowTest.test_configure_proxyreliefcCr)Nr�rDryrrr�test_configure_sashcursor�rz)PanedWindowTest.test_configure_sashcursorc	Cr�)Nr�rtr�r�r�r�r�ryrrr�test_configure_sashpad�r�z&PanedWindowTest.test_configure_sashpadcCr)Nr�rFryrrr�test_configure_sashrelief�rz)PanedWindowTest.test_configure_sashreliefc
Cr�)Nr�r�g333333&@rmr�rwr�r�ryrrr�test_configure_sashwidthr�z(PanedWindowTest.test_configure_sashwidthcCr)Nr�r[ryrrr�test_configure_showhandlerz)PanedWindowTest.test_configure_showhandlecCr�)	NrLr�gfffff6y@g�����Iy@r�rrir�r�ryrrrr�r�z$PanedWindowTest.test_configure_widthcCs:|��}t�|�}t�|�}|�|�|�|�|||fSr)rrNr��add�r%�pr�r�rrr�create2s




zPanedWindowTest.create2cCs�|��\}}}|�t|j�|�|�}|�|t�|��D]"\}}|�t|�d�|�||�||��|�|d|�	||��qdS)Nr4r�)
r�r�r`�
paneconfigurer%r:r;rr��panecget)r%r�r�r�r<r=r�rrr�test_paneconfigures
�z"PanedWindowTest.test_paneconfigureFcCsvdd�}|jr	|r
t|�}|jr|rt}|j|fi||i��|�||�||�d�|�|�||�||��|�dS)NcSs|Srrrrrrr#sz5PanedWindowTest.check_paneconfigure.<locals>.<lambda>r�)r5r�r�rr�)r%r�r�r|r�r~�	stringifyr�rrr�check_paneconfigure"s

z#PanedWindowTest.check_paneconfigurecCsH|�t|��|j|fi|di��Wd�dS1swYdS)NZbadValue)rrr�)r%r�r�r|�msgrrr�check_paneconfigure_bad,s"�z'PanedWindowTest.check_paneconfigure_badcC�8|��\}}}|�||d|t|��|�||dd�dS)NZafter�bad window path name "badValue"�r�r�r�r�r�rrr�test_paneconfigure_after0�

�z(PanedWindowTest.test_paneconfigure_aftercCr�)N�beforer�r�r�rrr�test_paneconfigure_before6r�z)PanedWindowTest.test_paneconfigure_beforecC�>|��\}}}|j||dddt�dkd�|�||dd�dS)NrAr�r��r��bad screen distance "badValue"�r�r�rr�r�rrr�test_paneconfigure_height<��
�z)PanedWindowTest.test_paneconfigure_heightcC�4|��\}}}|�||ddd�|�||dd�dS)N�hideFrz)expected boolean value but got "badValue"�r�r�r�r�rrr�test_paneconfigure_hideC�

�z'PanedWindowTest.test_paneconfigure_hidecCs4|��\}}}|�||ddd�|�||dd�dS)NZminsizer�r�r�r�rrr�test_paneconfigure_minsizeJ�

�z*PanedWindowTest.test_paneconfigure_minsizecCr�)NrFr�r2r�r�r�rrr�test_paneconfigure_padxPr�z'PanedWindowTest.test_paneconfigure_padxcCr�)NrGr�r2r�r�r�rrr�test_paneconfigure_padyVr�z'PanedWindowTest.test_paneconfigure_padycCr�)NZstickyZnsewZneswz[bad stickyness value "badValue": must be a string containing zero or more of n, e, s, and wr�r�rrr�test_paneconfigure_sticky\r�z)PanedWindowTest.test_paneconfigure_stickycCr�)NZstretchZalw�alwayszEbad stretch "badValue": must be always, first, last, middle, or neverr�r�rrr�test_paneconfigure_stretchdr�z*PanedWindowTest.test_paneconfigure_stretchcCr�)NrLr�r�r�r�r�r�rrr�test_paneconfigure_widthlr�z(PanedWindowTest.test_paneconfigure_widthN)F)"r!r:r;rarrrr�r�r�r�rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr��sH	










r�c@s\eZdZdZeZdd�Zdd�Zdd�Zdd	�Z	d
d�Z
dd
�Zdd�Zdd�Z
dd�ZdS)�MenuTest)r�Zactiveborderwidthr�r>r?r@r�rgrh�postcommandrHr�rJ�tearoff�tearoffcommandr"�typecKrMr)rNrUrOrPrrrrrRzMenuTest.createcCr)Nr�r ryrrr�test_configure_postcommand�rz#MenuTest.test_configure_postcommandcCr)Nr�r[ryrrr�test_configure_tearoff�rzMenuTest.test_configure_tearoffcCr)Nr�r ryrrr�test_configure_tearoffcommand�rz&MenuTest.test_configure_tearoffcommandcCs|��}|�|dd�dS)Nr"r�r&ryrrr�test_configure_title�szMenuTest.test_configure_titlecCs"|��}|j|dddddd�dS)Nr�r�r�Zmenubarz2bad type "{}": must be normal, tearoff, or menubarrr�ryrrr�test_configure_type�s
�zMenuTest.test_configure_typecCs�|��}|jdd�|�t|j�|�td��
|�d�Wd�n1s'wY|�d�}|�|t�|�	�D],\}}|�|t
�|�|t�|�t
|�d�|�|d|�|�|�d|�|d�q;|��dS)	Nr��r�zbad menu entry index "foo"r{r2r4rr�)r�add_commandr�r`�entryconfigurerrr%r:r;r��tuplerr��	entrycgetr�)r%�m1r<r=r�rrr�test_entryconfigure�s�
zMenuTest.test_entryconfigurecCsN|��}|jdd�|�|�dd�d�|jddd�|�|�dd�d�dS)Nr�r�r2r��changed)rr�rr�r�)r%r�rrr�test_entryconfigure_label�s
z"MenuTest.test_entryconfigure_labelcCs||��}t�|j�}t�|j�}|j|dddd�|�t|�dd��t|��|jd|d�|�t|�dd��t|��dS)NTFZNonsense)r�r�r�r�r2r�r�)	rrNZ
BooleanVarrOZadd_checkbuttonrr�r�r�)r%r�Zv1Zv2rrr�test_entryconfigure_variable�s
� z%MenuTest.test_entryconfigure_variableN)r!r:r;rar
r�rr�r�r�r�r�r�r�r�rrrrr�tsr�c@s$eZdZdZeZdd�Zdd�ZdS)�MessageTest)r��aspectr>r?r@rgrhrBrCrDr�rFrGrHrJrkr�rLcKrMr)rNZMessagerOrPrrrr�rRzMessageTest.createcCr�)Nr��ri���r�ryrrr�test_configure_aspect�r�z!MessageTest.test_configure_aspectN)r!r:r;rar
r<rr�rrrrr��s
r�c@seZdZdd�Zdd�ZdS)�DefaultRootTestcC�|�tj�dSr)�_test_widgetrNrdrrrr�
test_frame�rDzDefaultRootTest.test_framecCr�r)r�rNrrrrr�
test_label�rDzDefaultRootTest.test_labelN)r!r:r;r�r�rrrrr��sr��__main__)0ZunittestrNrrYZtest.supportrZtkinter.test.supportrrrrrZtkinter.test.widget_testsr	r
rrr
rrrrrZTestCaser=rcrfr�r�r�r�r�r�r�rr9rcr�r,rWrsr�r�r�r�Z	tests_guir!�mainrrrr�<module>s~(%(	6@
^xC21G
�
�