HEX
Server: Apache
System: Linux bd12.noc223.com 4.18.0-553.121.1.lve.el8.x86_64 #1 SMP Thu Apr 30 16:40:41 UTC 2026 x86_64
User: handcraf (1693)
PHP: 8.1.28
Disabled: NONE
Upload Files
File: //opt/alt/python312/lib64/python3.12/test/test_tkinter/__pycache__/test_widgets.cpython-312.pyc
�

}h�e�����ddlZddlZddlmZddlZddlmZddlmZmZm	Z	m
Z
ddlmZm
Z
mZmZmZed�d�ZGd�d	e
e�Zee�Gd
�deej&��Zee�Gd�d
eej&��Zee�Gd�deej&��ZGd�de
e�Zee�Gd�deej&��Zee�Gd�deej&��Zee�Gd�deej&��Zee�Gd�deej&��Zee�Gd�deej&��ZGd�deej&�Zeee�Gd�de
ej&��Zee�Gd �d!eej&��Zee�Gd"�d#e
ej&��Z eee�Gd$�d%e
ej&��Z!eee�Gd&�d'e
ej&��Z"eee�Gd(�d)e
ej&��Z#eee�Gd*�d+e
ej&��Z$ee�Gd,�d-e
ej&��Z%ee�Gd.�d/e
ej&��Z&eee�Gd0�d1e
ej&��Z'Gd2�d3e
ej&�Z(ee!eeeeee"ee&e'ee%ee#e$ee ee(fZ)e*d4k(rejV�yy)5�N)�TclError)�requires)�requires_tk�get_tk_patchlevel�	widget_eq�AbstractDefaultRootTest)�add_standard_options�AbstractWidgetTest�StandardOptionsTests�IntegerSizeTests�PixelSizeTests�guic�*�tt|��S�N)�float�round)�xs �E/opt/alt/python312/lib64/python3.12/test/test_tkinter/test_widgets.py�float_roundrs����q��?��c�(�eZdZdZd�Zd�Zd�Zd�Zy)�AbstractToplevelTestFc�
�|j�}|j|d|jjj	��|j|ddd��|jd��}|j|dd�y)N�class�Fooz2can't modify -class option after widget is created��errmsg)�class_)�create�assertEqual�	__class__�__name__�title�checkInvalidParam��self�widget�widget2s   r�test_configure_classz)AbstractToplevelTest.test_configure_classs{��������������)�)�2�2�8�8�:�	<����v�w��K�	�	M��+�+�U�+�+�������)�5�1rc���|j�}|j|dd�|j|ddd��|jd��}|j|dd�y)N�colormap��newz5can't modify -colormap option after widget is createdr)r+�rr r$r%s   r�test_configure_colormapz,AbstractToplevelTest.test_configure_colormap!sd�����������
�+�R�0����v�z�5�N�	�	P��+�+�u�+�-�������,�e�4rc��|j�}|j|d|jrdnd�|j|ddd��|jd��}|j|d|jrd�yd	�y)
N�	containerr�0�z6can't modify -container option after widget is createdrT�r1�1)rr �wantobjectsr$r%s   r�test_configure_containerz-AbstractToplevelTest.test_configure_container)s{������������,�4�3C�3C�a��M����v�{�A�O�	�	Q��+�+��+�-�������-�D�4D�4D�q�N�#�Nrc���|j�}|j|dd�|j|ddd��|jd��}|j|dd�y)N�visualr,�defaultz3can't modify -visual option after widget is createdr)r9r.r%s   r�test_configure_visualz*AbstractToplevelTest.test_configure_visual1sd������������)�2�.����v�x��L�	�	N��+�+�Y�+�/�������*�I�6rN)r"�
__module__�__qualname__�_conv_pad_pixelsr)r/r7r;�rrrrs����2�5�O�7rrc�(�eZdZdZd�Zd�Zd�Zd�Zy)�ToplevelTest)�
background�borderwidthrr+r1�cursor�height�highlightbackground�highlightcolor�highlightthickness�menu�padx�pady�relief�screen�	takefocus�user9�widthc�B�tj|jfi|��Sr)�tkinter�Toplevel�root�r&�kwargss  rrzToplevelTest.createDs������	�	�4�V�4�4rc��|j�}tj|j�}|j	|d|t
��|j	|dd�y)NrI��eqr,)rrR�MenurT�
checkParamr�r&r'rIs   r�test_configure_menuz ToplevelTest.test_configure_menuGsC��������|�|�D�I�I�&����������;�������+rc�n�|j�}|jdk7r|jd�|j|dd�	tj
d}|j|dd��|j|�	�}|j|d|�y#t$r|jd�Y�YwxYw)
N�x11zNot using Tk for X11rMr,�DISPLAYzNo $DISPLAY set.z3can't modify -screen option after widget is createdr)rM)r�_windowingsystem�skipTestr �os�environ�KeyErrorr$)r&r'�displayr(s    r�test_configure_screenz"ToplevelTest.test_configure_screenMs���������"�"�e�+��M�M�0�1������)�2�.�	.��j�j��+�G�	
���v�x��L�	�	N��+�+�W�+�-�������*�G�4���	.��M�M�,�-�	.�s�B�B4�3B4c�@�|j�}|j|dd�|jd��}t|j��}|j	|��5|j|��}|j|d|�ddd�y#1swYyxYw)NrOr,Tr4)�wid)rO)rr �hex�winfo_id�subTest)r&r'�parentrir(s     r�test_configure_usezToplevelTest.test_configure_use[s���������������+����t��,���&�/�/�#�$��
�\�\�c�\�
"�	2��k�k�c�k�*�G����W�U�^�S�1�	2�	2�	2�s�#(B�BN)r"r<r=�OPTIONSrr]rgrnr?rrrArA:s���G�5�,�5�2rrAc��eZdZdZd�Zy)�	FrameTest)rBrCrr+r1rDrErFrGrHrJrKrLrNr9rPc�B�tj|jfi|��Sr)rR�FramerTrUs  rrzFrameTest.createn����}�}�T�Y�Y�1�&�1�1rN�r"r<r=rorr?rrrqrqes���G�2rrqc�"�eZdZdZd�Zd�Zd�Zy)�LabelFrameTest)rBrCrr+r1rD�font�
foregroundrErFrGrH�labelanchor�labelwidgetrJrKrLrN�textr9rPc�B�tj|jfi|��Sr)rR�
LabelFramerTrUs  rrzLabelFrameTest.create}����!�!�$�)�)�6�v�6�6rc��|j�}|j|ddddddddd	d
ddd
�|j|dd�y)Nrz�e�en�es�n�ne�nw�s�se�sw�w�wn�ws�center)r�checkEnumParamr$�r&r's  r�test_configure_labelanchorz)LabelFrameTest.test_configure_labelanchor�sM����������F�M���t�S�$����t�S�$��	>�	
���v�}�h�?rc��|j�}tj|jdd��}|j	|d|d��|j�y)N�Mupp�foo)r|�namer{z.foo��expected)rrR�LabelrTr[�destroy)r&r'�labels   r�test_configure_labelwidgetz)LabelFrameTest.test_configure_labelwidget�s@��������
�
�d�i�i�f�5�A������
�u�v��F�
�
�
�rN)r"r<r=rorr�r�r?rrrwrwrs���G�7�@�rrwc��eZdZdZd�Zy)�AbstractLabelTestFc
�T�|j�}|j|ddddddd�y)NrHr��������?�������@�����10p�r�checkPixelsParamr�s  r�!test_configure_highlightthicknessz3AbstractLabelTest.test_configure_highlightthickness�s-����������f�&:���c�1�b�%�	9rN)r"r<r=�_conv_pixelsr�r?rrr�r��s���L�9rr�c��eZdZdZd�Zy)�	LabelTest)�activebackground�activeforeground�anchorrB�bitmaprC�compoundrD�disabledforegroundrxryrErFrGrH�image�justifyrJrKrL�staterNr|�textvariable�	underlinerP�
wraplengthc�B�tj|jfi|��Sr)rRr�rTrUs  rrzLabelTest.create�rtrNrur?rrr�r��s���G�2rr�c��eZdZdZd�Zd�Zy)�
ButtonTest) r�r�r�rBr�rC�commandr�rDr:r�rxryrErFrGrHr�r��
overreliefrJrKrL�repeatdelay�repeatintervalr�rNr|r�r�rPr�c�B�tj|jfi|��Sr)rR�ButtonrTrUs  rrzButtonTest.create�����~�~�d�i�i�2�6�2�2rc�N�|j�}|j|dddd�y)Nr:�active�disabled�normal�rr�r�s  r�test_configure_defaultz!ButtonTest.test_configure_default�s#����������F�I�x��X�NrN)r"r<r=rorr�r?rrr�r��s��	,�G�3�Orr�c�.�eZdZdZd�Zd�Zd�Zd�Zd�Zy)�CheckbuttonTest)&r�r�r�rBr�rCr�r�rDr�rxryrErFrGrHr��indicatoronr��	offrelief�offvalue�onvaluer�rJrKrL�selectcolor�selectimager�rNr|r��
tristateimage�
tristatevaluer��variablerPr�c�B�tj|jfi|��Sr)rR�CheckbuttonrTrUs  rrzCheckbuttonTest.create�����"�"�4�9�9�7��7�7rc�P�|j�}|j|ddddd�y)Nr�r3�ffffff@r,�
any string�r�checkParamsr�s  r�test_configure_offvaluez'CheckbuttonTest.test_configure_offvalue�s%������������Q��R��Frc�P�|j�}|j|ddddd�y)Nr�r3r�r,r�r�r�s  r�test_configure_onvaluez&CheckbuttonTest.test_configure_onvalue�s%������������A�s�B��Erc��g}g}td�D]�}tj|j�}|j	�|j|�dD]:}tj||��}|j	�|j|��<��|D�cgc]}t|d���}}|jtt|��d|�ycc}w)N��AB)r|r��)�rangerRrsrT�pack�appendr��strr �len�set)r&�frames�buttons�i�f�j�b�	variabless        r�test_unique_variablesz%CheckbuttonTest.test_unique_variables�s��������q��	"�A��
�
�d�i�i�(�A�
�F�F�H��M�M�!���
"���'�'���2���������q�!�
"�		"�29�9�A�S��:��'�9�	�9�����S��^�,�a��;��:s�Cc���tj|j�}tj|j�}tj|dd��}tj|dd��}tj|jd��}|j�|j
|j�d�|j�|j
|j�d�y)N�test�Test1)r�r|�Test2�r�r3r)	rRrsrTr��IntVar�selectr �get�deselect)r&�f1�f2�b1�b2�vs      r�test_same_namezCheckbuttonTest.test_same_name�s���
�]�]�4�9�9�
%��
�]�]�4�9�9�
%��
�
 �
 ��&�w�
?��
�
 �
 ��&�w�
?���N�N�4�9�9�6�2��
�	�	���������!�$�
���
��������!�$rN)	r"r<r=rorr�r�r�r�r?rrr�r��s$���G�8�G�F�<�
%rr�c��eZdZdZd�Zd�Zy)�RadiobuttonTest)%r�r�r�rBr�rCr�r�rDr�rxryrErFrGrHr�r�r�r�r�rJrKrLr�r�r�rNr|r�r�r�r��valuer�rPr�c�B�tj|jfi|��Sr)rR�RadiobuttonrTrUs  rrzRadiobuttonTest.creater�rc�P�|j�}|j|ddddd�y)Nr�r3r�r,r�r�r�s  r�test_configure_valuez$RadiobuttonTest.test_configure_values%������������!�S�"�l�CrN)r"r<r=rorrr?rrr�r��s���G�8�Drr�c�\�eZdZdZeZd�Zd�Zd�Ze	jZ
d�Zd�Zd�Z
d�Zd	�Zy
)�MenubuttonTest)r�r�r�rBr�rCr�rD�	directionr�rxryrErFrGrHr�r�r�rIrJrKrLr�rNr|r�r�rPr�c�B�tj|jfi|��Sr)rR�
MenubuttonrTrUs  rrzMenubuttonTest.createrrc	�R�|j�}|j|dddddd�y)Nr�above�below�flush�left�rightr�r�s  r�test_configure_directionz'MenubuttonTest.test_configure_directions*����������F�K���'�6�7�	<rc�Z�|j�}|j|ddddt��y)NrE�d���r��conv�r�checkIntegerParamr�r�s  r�test_configure_heightz$MenubuttonTest.test_configure_height!s(����������v�x��d�A�C��Hrc�:�|j�}tj|jd��}|j	|d|t
��d}|j
tj�5}d|d<ddd�|�%|jtj�|�|j
tj�5}|jddi�ddd�|�&|jtj�|�yy#1swY��xYw#1swY�>xYw)N�image1)�masterr�r�rzimage "spam" doesn't exist�spam)rrR�
PhotoImagerTr[r��assertRaisesrr �	exception�	configure)r&r'r�r�cms     r�test_configure_imagez#MenubuttonTest.test_configure_image(s���������"�"�$�)�)�(�C��������S��9�.��
�
�
�w�/�/�
0�	%�B�$�F�7�O�	%������S����.��7�
�
�
�w�/�/�
0�	0�B����g�v�.�/�	0������S����.��7��
	%�	%��	0�	0�s�,D�D�D�Dc��|j�}tj|d��}|j|d|t��|j�y)NrIr�rX)rrRrZr[rr�r\s   rr]z"MenubuttonTest.test_configure_menu6s:��������|�|�F��0����������;����rc�z�|j�}|j|ddddd�|j|ddd��y)	NrJ�皙����@�ffffff@�12mr�rr��rr�r[r�s  r�test_configure_padxz"MenubuttonTest.test_configure_padx<�9����������f�f�a��c�5�A�������Q��7rc�z�|j�}|j|ddddd�|j|ddd��y)	NrKr#r$r%r&r�rr�r'r�s  r�test_configure_padyz"MenubuttonTest.test_configure_padyAr)rc�Z�|j�}|j|ddddt��y)NrP��n���rrrr�s  r�test_configure_widthz#MenubuttonTest.test_configure_widthFs(����������v�w��T�1�3��GrN)r"r<r=rorr�rrrrr�r r]r(r+r/r?rrrr
sJ��
�G��L�7�<�
I�
	�>�>�&�8��8�
8�
Hrrc��eZdZdd�Zd�Zy)�OptionMenuTestc�L�tj|jd|g|��i|��Sr)rR�
OptionMenurT)r&r:�valuesrVs    rrzOptionMenuTest.createMs%���!�!�$�)�)�T�7�N�V�N�v�N�Nrc��|jtd�5tj|jddd��ddd�y#1swYyxYw)Nz^unknown option -image$r�r,)r�)�assertRaisesRegexrrRr3rT�r&s r�test_bad_kwargzOptionMenuTest.test_bad_kwargPs@��
�
#�
#�H�.H�
I�	?����t�y�y�$��2�>�	?�	?�	?�s�$A�A
N)r�)�ar��c)r"r<r=rr8r?rrr1r1Ks
��O�?rr1c�R�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zy
)�	EntryTest)rBrCrD�disabledbackgroundr��exportselectionrxryrFrGrH�insertbackground�insertborderwidth�
insertofftime�insertontime�insertwidth�invalidcommandr��readonlybackgroundrL�selectbackground�selectborderwidth�selectforeground�showr�rNr��validate�validatecommandrP�xscrollcommandc�B�tj|jfi|��Sr)rR�EntryrTrUs  rrzEntryTest.createdrtrc�H�|j�}|j|d�y)Nr=�r�checkColorParamr�s  r�!test_configure_disabledbackgroundz+EntryTest.test_configure_disabledbackgroundg�����������V�%9�:rc
��|jd��}|j|ddddddd	�|j|dd
d��y)
Nr)rCr@rr�r�r�r�r��<�2r�r'r�s  r� test_configure_insertborderwidthz*EntryTest.test_configure_insertborderwidthksI�������-�����f�&9���c�1�b�%�	9�	
���� 3�R�&��Irc���|j�}|j|dddd�|j|ddd��|j|ddd��|j|dd	d
��y)NrCr��������@r�g�������?r�r�r�g�������?r3r'r�s  r�test_configure_insertwidthz$EntryTest.test_configure_insertwidthrs_����������f�m�S�#�u�E�����
�s�Q��?�����
�r�A��>�����
�s�Q��?rc�l�|j�}|j|d�|j|d�y)NrD�invcmd�r�checkCommandParamr�s  r�test_configure_invalidcommandz'EntryTest.test_configure_invalidcommandys.����������v�'7�8����v�x�0rc�H�|j�}|j|d�y)NrErPr�s  r�!test_configure_readonlybackgroundz+EntryTest.test_configure_readonlybackground~rSrc��|j�}|j|dd�|j|dd�|j|dd�y)NrI�*r,� �rr[r�s  r�test_configure_showzEntryTest.test_configure_show�s=�������������,�������+�������,rc�N�|j�}|j|dddd�y)Nr�r�r��readonlyr�r�s  r�test_configure_statezEntryTest.test_configure_state�s&����������F�G�&��*�	>rc
�T�|j�}|j|ddddddd�y)NrJ�all�key�focus�focusin�focusout�noner�r�s  r�test_configure_validatez!EntryTest.test_configure_validate�s-����������F�J��u�g�y�*�f�	Frc�l�|j�}|j|d�|j|d�y)NrK�vcmdr]r�s  r�test_configure_validatecommandz(EntryTest.test_configure_validatecommand�s.����������v�'8�9����v�v�.rc�<�|j�}|jdd�|j|j��|j	dd�|j|j
�d�|j|j��|jd�|jd�|j|j
�d�|j	dd�|j|j
�d	�|j�|j|j��|j	dd�|jd�|j|j
�d
�|jd�|j|j
�d�|jd�|j|j
�d
�|jd�|j|j
�d�|jd�y�Nr�12345�endr3r��2r#r��4�1234�234��2345�r�insert�assertFalse�selection_present�selection_ranger �
selection_get�
assertTrue�selection_from�selection_to�selection_clear�selection_adjustr�s  r�test_selection_methodsz EntryTest.test_selection_methods�s���������
�
�a��!�����1�1�3�4����q�%�(�����-�-�/��9�����0�0�2�3����a� ����A������-�-�/��5����q�!�$�����-�-�/��5���� �����1�1�3�4����q�%�(�����"�����-�-�/��8�����"�����-�-�/��7�����"�����-�-�/��8�����"�����-�-�/��9�����"rN)r"r<r=rorrRrWrZr_rarfrirqrtr�r?rrr<r<UsC���G�2�;�J�@�1�
;�-�>�
F�
/�
#rr<c�h�eZdZdZd�ZdZd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zy)�SpinboxTest),r�rBrC�buttonbackground�buttoncursor�buttondownrelief�buttonupreliefr�rDr=r�r>rxry�format�fromrFrGrH�	incrementr?r@rArBrCrDr�rLrEr�r�rFrGrHr�rNr��torJrKr4rP�wraprLc�B�tj|jfi|��Sr)rR�SpinboxrTrUs  rrzSpinboxTest.create�������t�y�y�3�F�3�3rNc�H�|j�}|j|d�y)Nr�rPr�s  r�test_configure_buttonbackgroundz+SpinboxTest.test_configure_buttonbackground�s����������V�%7�8rc�H�|j�}|j|d�y)Nr��r�checkCursorParamr�s  r�test_configure_buttoncursorz'SpinboxTest.test_configure_buttoncursor������������f�n�5rc�H�|j�}|j|d�y)Nr��r�checkReliefParamr�s  r�test_configure_buttondownreliefz+SpinboxTest.test_configure_buttondownrelief�s����������f�&8�9rc�H�|j�}|j|d�y)Nr�r�r�s  r�test_configure_buttonupreliefz)SpinboxTest.test_configure_buttonuprelief�s����������f�&6�7rc���|j�}|j|dd�|j|dd�|j|dd�|j|dd�|j|dd�|j|dd�|j|dd�|j|dd	�|j|dd
�|j|dd�|j|dd�|j|dd
�y)Nr�z%2fz%2.2fz%.2fz%2.fz%2e-1fz2.2z%2.-2fz%-2.02fz% 2.02fz	% -2.200fz%09.200fz%d�rr[r$r�s  r�test_configure_formatz!SpinboxTest.test_configure_format�s�������������%�0������'�2������&�1������&�1����v�x��:����v�x��7����v�x��:������)�4������)�4������+�6������*�5����v�x��6rc��|j�}|j|dd�|j|dddd�|j|ddd�	�y)
Nr�gY@r�����ffffff$@�ffffff'@���*-to value must be greater than -from valuer�rr[�checkFloatParamr$r�s  r�test_configure_fromzSpinboxTest.test_configure_from�sP������������e�,����V�V�S�$��=����v�v�s�C�	�	Erc	�R�|j�}|j|dddddd�y)Nr����r3r�g������)@r�rr�r�s  r�test_configure_incrementz$SpinboxTest.test_configure_increment�s'����������V�[�"�a��t�Q�Grc��|j�}|j|dd�|j|dddd�|j|ddd�	�y)
Nr�gY�r�r�r�r�i8���r�rr�r�s  r�test_configure_tozSpinboxTest.test_configure_to�sP�������������/����V�T�3��d�;����v�t�T�C�	�	Erc���|j�}|j|dd�|j|dd�|j|ddd��|j|ddd��|j|dd�y)Nr4r,zmon tue wed thur)�mon�tue�wed�thurr�)�*g��Q�	@r,r�z42 3.14 {} {any string})rr r[r�s  r�test_configure_valuesz!SpinboxTest.test_configure_values�sy������������)�2�.������*<�=������*G�!3�	�	5������*F�!:�	�	<������"�-rc�H�|j�}|j|d�y)Nr��r�checkBooleanParamr�s  r�test_configure_wrapzSpinboxTest.test_configure_wrap�����������v�v�.rc��|j�}|j|jd��|jtj
|jd�|jtj
|jd�|jt|j�|jt|jdd�y)Nr�noindexr3)r�assertIsBoundingBox�bboxrrRr�	TypeErrorr�s  r�	test_bboxzSpinboxTest.test_bbox	s��������� � ����Q��0����'�*�*�F�K�K��C����'�*�*�F�K�K��>����)�V�[�[�1����)�V�[�[�!�Q�7rc��|j�}|jdd�|j|j��|j	dd�|j|j
�d�|j|j��|jd�|jd�|j|j
�d�|j	dd�|j|j
�d	�|j�|j|j��|j	dd�|jd�|j|j
�d
�|jd�|j|j
�d�|jd�|j|j
�d
�|jd�|j|j
�d�yrvrr�s  rr�z"SpinboxTest.test_selection_methodss���������
�
�a��!�����1�1�3�4����q�%�(�����-�-�/��9�����0�0�2�3����a� ����A������-�-�/��5����q�!�$�����-�-�/��5���� �����1�1�3�4����q�%�(�����"�����-�-�/��8�����"�����-�-�/��7�����"�����-�-�/��8�����"�����-�-�/��9rc�(�|j�}|j|j�d�|jd�|j|j�d�|jd�|j|j�d�y)Nrp�buttonup�
buttondown)rr �selection_elementr�s  r�test_selection_elementz"SpinboxTest.test_selection_element)st�����������1�1�3�V�<�� � ��,�����1�1�3�Z�@�� � ��.�����1�1�3�\�Br)r"r<r=rorrfr�r�r�r�r�r�r�r�r�r�r�r�r�r?rrr�r��s[���G�"4���9�6�:�8�
7�E�H�E�	.�/�8�:�0Crr�c��eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
ed	d
�d��Zd�Z
d
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zy)�TextTest))�autoseparatorsrB�blockcursorrCrD�endliner>rxryrErFrGrH�inactiveselectbackgroundr?r@rArB�insertunfocussedrC�maxundorJrKrLrFrGrH�setgrid�spacing1�spacing2�spacing3�	startliner��tabs�tabstylerN�undorPr�rL�yscrollcommandc�B�tj|jfi|��Sr)rR�TextrTrUs  rrzTextTest.createB����|�|�D�I�I�0��0�0rc�H�|j�}|j|d�y)Nr�r�r�s  r�test_configure_autoseparatorsz&TextTest.test_configure_autoseparatorsE�����������v�'7�8rc�H�|j�}|j|d�y)Nr�r�r�s  r�test_configure_blockcursorz#TextTest.test_configure_blockcursorI�����������v�}�5rc�~�|j�}djd�td�D��}|jd|�|j	|ddd��|j	|dd	d��|j|dd
d��|j	|dd
�|j	|dd�|j|ddd��y)N�
c3� K�|]}d���y�w�zLine %dNr?��.0r�s  r�	<genexpr>z2TextTest.test_configure_endline.<locals>.<genexpr>O�����7�q��7���rrxr�r�r,r�r�r�expected integer but got "spam"rrVr���
�1-startline must be less than or equal to -endline�r�joinr�r�r[r$�r&r'r|s   r�test_configure_endlinezTextTest.test_configure_endlineMs���������y�y�7�E�#�J�7�7���
�
�e�T�"�����	�3���<�����	�3���<����v�y�&�8�	�	:�����	�2�.������R�0����v�y�"�J�	�	Lrc��|j�}|j|ddddd�|j|ddd��|j|dd	d��y)
NrEr������LY@�fffff�Y@�3crr3r�rr'r�s  rrzTextTest.test_configure_heightZsM����������f�h��U�E�4�H������$���;������!�a��8rc�N�|j�}|j|dddd�y)Nr�rr}r��rrr�s  r�test_configure_maxundozTextTest.test_configure_maxundo`s#����������v�y�!�Q��;rc�H�|j�}|j|d�y)Nr�rPr�s  r�'test_configure_inactiveselectbackgroundz0TextTest.test_configure_inactiveselectbackgroundds����������V�%?�@r�r�c�N�|j�}|j|dddd�y)Nr��hollowrp�solidr�r�s  r�test_configure_insertunfocussedz(TextTest.test_configure_insertunfocussedhs'����������F�$6�$�f�g�	7rc	�T�|j�}|j|dddddd��y)NrGr�r�r�r�Frr�r�s  r� test_configure_selectborderwidthz)TextTest.test_configure_selectborderwidthns0����������f�&9�!�3��E��	�	?rc�z�|j�}|j|ddddd�|j|ddd��y)	Nr���ffffff5@皙����6@�0.5c���rr�r'r�s  r�test_configure_spacing1z TextTest.test_configure_spacing1ss9����������f�j�"�d�D�&�I�����
�B���;rc�z�|j�}|j|ddddd�|j|ddd��y)	Nr�r}皙����@�ffffff@z0.1cr�rr�r'r�s  r�test_configure_spacing2z TextTest.test_configure_spacing2xs9����������f�j�!�S�#�v�F�����
�B���;rc�z�|j�}|j|ddddd�|j|ddd��y)	Nr�rr
rrr�rr�r'r�s  r�test_configure_spacing3z TextTest.test_configure_spacing3}s9����������f�j�"�d�D�&�I�����
�C�!��<rc�~�|j�}djd�td�D��}|jd|�|j	|ddd��|j	|dd	d��|j|dd
d��|j	|dd
�|j	|dd�|j|ddd��y)Nr�c3� K�|]}d���y�wr�r?r�s  rr�z4TextTest.test_configure_startline.<locals>.<genexpr>�r�r�rrxr�r�r,r�r�rr�rr�r�rV�Fr�r�r�s   r�test_configure_startlinez!TextTest.test_configure_startline�s���������y�y�7�E�#�J�7�7���
�
�e�T�"������S�2��>������S�2��>����v�{�F�8�	�	:������R�0�����	�2�.����v�{�B�J�	�	Lrc�L�|j�}|j|ddd�y�Nr�r�r�r�r�s  rrizTextTest.test_configure_state��!����������F�G�Z��Brc���|j�}|j|dd�|j|ddd��|j|ddd��|j|ddd	�
�y)Nr�)r�g33333�4@�1i�2iz10.2 20.7 1i 2i)z10.2z20.7r r!r�z2c left 4c 6c center)�2cr�4c�6cr�rzbad screen distance "spam"rr�r�s  r�test_configure_tabszTextTest.test_configure_tabs�sr������������(@�A������(9�!=�	�	?������(>�!E�	�	G����v�v�v�&B�	�	Drc�L�|j�}|j|ddd�y)Nr��tabular�
wordprocessorr�r�s  r�test_configure_tabstylez TextTest.test_configure_tabstyle�s!����������F�J�	�?�Krc�H�|j�}|j|d�y)Nr�r�r�s  r�test_configure_undozTextTest.test_configure_undo�r�rc��|j�}|j|dd�|j|ddd��|j|ddd��y)NrPr-r.r3r�r)rrr[r�s  rr/zTextTest.test_configure_width�sG����������v�w��4���������:�������Q��7rc�N�|j�}|j|dddd�y)Nr��charrp�wordr�r�s  rr�zTextTest.test_configure_wrap�s#����������F�F�F�F�F�Crc���|j�}|j|jd��|j|jd��|j	t
j|jd�|j	t
j|jd�|j	t|j�|j	t|jdd�y)Nz1.1rxr�)rr�r��assertIsNonerrRrr�r�s  rr�zTextTest.test_bbox�s��������� � ����U�!3�4����&�+�+�e�,�-����'�*�*�F�K�K��C����'�*�*�F�K�K��>����)�V�[�[�1����)�V�[�[�%��?rN)r"r<r=rorr�r�r�rrrrrr
rrrrrir%r)r+r/r�r�r?rrr�r�2s����G�1�9�6�L�9�<�A���A��7��7�
?�
<�
<�
=�
L�C�D�L�/�8�D�@rr�c��eZdZdZeZdZd�Zd�Zd�Z	d�Z
d�Zd�Zd	�Z
d
�Zd�Zd�Zd
�Zd�Zd�Zd�Zedd�d��Zy)�
CanvasTest)rBrC�closeenough�confinerDrErFrGrHr?r@rArBrC�offsetrL�scrollregionrFrGrHr�rNrL�xscrollincrementr��yscrollincrementrPTc�B�tj|jfi|��Sr)rR�CanvasrTrUs  rrzCanvasTest.create�r�rc	�\�|j�}|j|dddddt��y)Nr4��333333@rY���r)rr�rr�s  r�test_configure_closeenoughz%CanvasTest.test_configure_closeenough�s/����������V�]�B��S�"�"'�	�	)rc�H�|j�}|j|d�y)Nr5r�r�s  r�test_configure_confinez!CanvasTest.test_configure_confine������������v�y�1rc
��|j�}|j|dd�|j|dddddddd	d
d�|j|dd�|j|dd
�|j	|dd�y)Nr6z0,0r�r�r�r�r�r�r�r�r�z10,20z#5,6r)rr r�r[r$r�s  r�test_configure_offsetz CanvasTest.test_configure_offset�sz������������)�5�1�������T�3��c�4��d�H�	F������'�2������&�1����v�x��8rc�6�|j�}|j|dd�|j|ddd��|j|dd�|j|ddd��|j|dd	�|j|dd
�|j|dd�y)Nr7z0 0 200 150)rrr��r�r,rzbad scrollRegion "spam"r)rrr�r)rrr�)rrr�rGrr�r�s  r�test_configure_scrollregionz&CanvasTest.test_configure_scrollregion�s�������������
�>������0@�!.�	�	0�������3����v�~�v�&?�	�	A����v�~�7J�K����v�~�{�C����v�~�7J�Krc�P�|j�}|j|dddd��y)Nr�r�r�z0bad state value "{}": must be normal or disabledrr�r�s  rrizCanvasTest.test_configure_state�s,����������F�G�Z��I�	�	Krc
�T�|j�}|j|ddddddd�y)Nr8�(rg������D@g������E@i���z0.5ir�r�s  r�test_configure_xscrollincrementz*CanvasTest.test_configure_xscrollincrement��-����������f�&8� �!�T�4��f�	>rc
�T�|j�}|j|ddddddd�y)Nr9r�r�ffffff&@g333333+@r�z0.1ir�r�s  r�test_configure_yscrollincrementz*CanvasTest.test_configure_yscrollincrement�rMrc��dD]-}||��}|j|j|d�|��/|jt|d��y)N)�bevel�miterr)�	joinstylerTr�r �itemcgetrr)r&r:�factoryrTr�s     r�_test_option_joinstylez!CanvasTest._test_option_joinstyle�sO��2�	D�I��)�,�A����Q�Z�Z��;�7��C�	D�	
���(�G�v��>rc�4�dD]-}||��}|j|j|d�d��/dD]-}||��}|j|j|d�d��/|dd�	�}|j|j|d�d�|j|j|d
�d�|dd�	�}|j|j|d�d�|j|j|d
�d�|jt|d
��y)N)r3Tr5�true�yes�on)�smoothr]rZ)rFr2�false�no�offr2T�)r]�
splinesteprb�30�rawrrU)r&r:rWr]r�s     r�_test_option_smoothzCanvasTest._test_option_smooths��7�	>�F��v�&�A����Q�Z�Z��8�4�f�=�	>�:�	;�F��v�&�A����Q�Z�Z��8�4�c�:�	;�
�4�B�/��������A�x�0�&�9�������A�|�4�d�;��5�R�0��������A�x�0�%�8�������A�|�4�d�;����(�G�F��;rc
��|j�}|jdddd�}|j|j|�gd��|j|j	|�d�|jgd��}|j|j|�gd��|j|j	|�d	�|jd
d�}|j|j|�gd��|j|j	|�d
�|jddg�}|j|j|�gd��|j|j	|�d�|jt|jddd�|jt|jgd��|jt|jdddddd�|jt|jgd��|jt|jdd�|jt|jddg�|jt|j�|jt|jg�y)NrrarUr�)�4@�$@�N@�>@)��	�=�)�rnrm�)�5@�&@��N@�?@)rr��>� ��rv�ru�)�6@�(@�O@�@@)rorp�?�!��r��r�
)�7@�*@��O@��@@)rxrz�@�"�rrarUrKrV�rrarKrVrUr�)r�create_rectangler �coordsr�rr�
IndexError)r&r:�i1�i2�i3�i4s      r�test_create_rectanglez CanvasTest.test_create_rectangles����K�K�M��
�
�
��B��B�
/��������"��'?�@���������_�5�
�
�
� 0�
1��������"��'?�@���������%5�6�
�
�
��(�
3��������"��'?�@���������%5�6�
�
�
��8� 4�
5��������"��'?�@���������%5�6����(�A�$6�$6��B��C����(�A�$6�$6��E����(�A�$6�$6��B��B��B�O����(�A�$6�$6�8P�Q����(�A�$6�$6��B�?����(�A�$6�$6��R��A����*�a�&8�&8�9����*�a�&8�&8�"�=rc	�r��|j���jdddddd�}|j�j|�gd��|j�j	|�d�|j�j|d	�d
�|j�j|d�d�|j�j|d
�d�|j�j|d�d�|j�j|d�d�|j�j|d�d��jgd��}|j�j|�gd��|j�j	|�d��jddd�}|j�j|�gd��|j�j	|�d��jgd��}|j�j|�gd��|j�j	|�d�|j
t�jddd�|j
t�jgd ��|j
t�jdd�|j
t�jddg�|j
t�j�|j
t�jg�d!D]:}�jdddd|�"�}|j�j|d	�|��<�jddddd#gd$��%�}|j�j|d�d&�|j
t�jddddd'�"�d(D]:}�jdddd|�)�}|j�j|d
�|��<|j
t�jddddd'�)�|j��fd*��|j��fd+��y),NrrarKrVrUr��rgrj�D@�I@rirh��rru�4�arrowrp�
arrowshapez8 10 3�capstyle�buttrTrr]r2rb�12�rorn�)�3rmrp�rqrtg�D@g�I@rsrr)rkrlr�5rw�r�r�ry�r{r~gE@gJ@r}r|)rr�r��6�r�)�+r�r��r�r�g�E@g�J@r�r�)rorp�A�7r�)rp�first�last�both)r�r�)r�r�r})r�r�z10 15 5r)r��
projectingr)r�c�(���jdi|��S�Nr���create_line�rVr:s �r�<lambda>z-CanvasTest.test_create_line.<locals>.<lambda>Ws�������!P��!P�rc�(���jdi|��S)N)rrarUr�r�r�s �rr�z-CanvasTest.test_create_line.<locals>.<lambda>Ys�������!H��!H�r)rr�r r�r�rVrrr�rXre)	r&r�r�r�r�r�r�r�r:s	        @r�test_create_linezCanvasTest.test_create_line+ss����K�K�M��
�]�]�2�r�2�r�2�r�
2��������"��'K�L���������_�5�������B��0�&�9�������B��5�x�@�������B�
�3�V�<�������B��4�g�>�������B��1�3�7�������B��5�t�<�
�]�]�3�
4��������"��'K�L���������_�5�
�]�]�8�X�x�
8��������"��'K�L���������%5�6�
�]�]�9�
:��������"��'K�L���������%5�6����(�A�M�M�2�r�2�>����(�A�M�M�<�@����(�A�M�M�2�r�:����(�A�M�M�B��8�<����*�a�m�m�4����*�a�m�m�R�8�4�	<�E��
�
�b�"�b�"�E�
�:�A����Q�Z�Z��7�3�U�;�	<�
�M�M�"�b�"�b��K�M�P��������A�|�4�i�@����(�A�M�M�2�r�2�r���P�5�	B�H��
�
�b�"�b�"�x�
�@�A����Q�Z�Z��:�6��A�	B�	
���(�A�M�M�2�r�2�r�F��S��#�#�A�P�	R�� � ��H�	Jrc���|j���jdddddd�}|j�j|�gd��|j�j	|�d�|j�j|d	�d
�|j�j|d�d�|j�j|d
�d��jgd��}|j�j|�gd��|j�j	|�d��jddd�}|j�j|�gd��|j�j	|�d��jgd��}|j�j|�gd��|j�j	|�d�|j
t�jddd�|j
t�jgd��|j
t�j�|j
t�jg�|j��fd��|j��fd��y)NrrarKrVrUr�r�)rkrlrmr�rTrr]r2rbr�r�r�)rr�rur�rwr�ryr�)rorprr�r�r�)rxrzr�r�r�c�(���jdi|��Sr���create_polygonr�s �rr�z0CanvasTest.test_create_polygon.<locals>.<lambda>v����!1��!1�!1�!S�F�!S�rc�(���jdi|��Sr�r�r�s �rr�z0CanvasTest.test_create_polygon.<locals>.<lambda>xr�r)rr�r r�r�rVrrr�rXre)r&r�r�r�r�r:s     @r�test_create_polygonzCanvasTest.test_create_polygon[s����K�K�M��
�
�
�b�"�b�"�b�"�
5��������"��'K�L���������_�5�������B��4�g�>�������B��1�3�7�������B��5�t�<�
�
�
�6�
7��������"��'K�L���������%5�6�
�
�
�h��(�
;��������"��'K�L���������%5�6�
�
�
�<�
=��������"��'K�L���������%5�6����(�A�$4�$4�b�"�b�A����(�A�$4�$4�l�C����*�a�&6�&6�7����*�a�&6�&6��;��#�#�A�S�	U�� � ��S�	Urc	��|j�}|jddddddd��}|j|j|�gd	��|j|jd�gd	��|j|j	|�d
�|j|ddddd
d�|j|j|�gd��|j|j	|�d�|j|gd��|j|j|�gd��|j|ddd�|j|j|�gd��|j|gd��|j|j|�gd��|j|dddd�|j|j|�gd��|j|j	|�d�|jt|j|ddd�|jt|j|gd��|jt|j|dd�|jt|j|ddg�|j|dddd�|j|�}|j|t�|jt|�d�|j|d d�td�D]}|j||t��y)!NrrarKrVrUr�r��tagsr�r�r�P�Z)r�rig�Q@gT@g�V@r�)�0�&�\�Rr�r�rwr�ryr�r�r�)rgrjrirh)r�rrurvr��20�30c�60ir�r�r)rr�r r�r�rr�assertIsInstance�listr�r�r)r&r:r�r�s    r�test_coordszCanvasTest.test_coordszsg���K�K�M��
�M�M�"�b�"�b�"�b�s�M�;��������!��&J�K�������#��(L�M���������O�4�	����B��B��B��+�������!��&J�K���������$4�5�	����,�-�������!��&J�K�	����H�h��1�������!��&J�K�	����2�3�������!��&J�K�	����B��B��#�������!��&>�?���������O�4����(�A�H�H�a��R��<����(�A�H�H�a��>����(�A�H�H�a��R�8����(�A�H�H�a�"�b��:�	����D�%���.����!������f�d�+�����V��a�(�������B�'��q��	4�A��!�!�&��)�U�3�	4rrr�c�D�|j�}|jddddd��}|jddddd��}|j|�\}}}}|j|�\}}}}|jddd	�|j|�\}	}
}}|j|�\}}}}|j	|	d�|j	|
d	�|j	||z
||	z
�|j	||z
||
z
�|j||�|jdd�
�|j|�\}
}}}|j|�\}}}}|j	|d�|j	||�|j	||	z
||
z
�|j	||
z
||z
�y)Nr3r�groupr�rarVrr�r)�y)rr�r��movetor �	tag_lower)r&r'r�r��x1�y1�_�x2�y2�x1_2�y1_2�x2_2�y2_2�x1_3�y1_3�x2_3�y2_3s                 r�test_movetozCanvasTest.test_moveto�s��������
�
$�
$�Q��2�r��
$�
@��
�
$�
$�R��R��'�
$�
B���{�{�2����B��1��{�{�2����B��1��
�
�g�s�C�(�!�;�;�r�?���d�A�q�!�;�;�r�?���d�A�q�����s�#�����s�#�����b��$��+�.�����b��$��+�.�����R� ��
�
�g��
�$�!�;�;�r�?���d�A�q�!�;�;�r�?���d�A�q�����r�"�����t�$�������d�T�k�2�������d�T�k�2rN)r"r<r=rorr��
_stringifyrr@rBrErHrirLrPrXrer�r�r�r�rr�r?rrr3r3�s|���G��L��J�3�)�
2�9�
L�K�
>�
>�
?�
<�>�6.J�`U�>#4�J��A��3��3rr3c��eZdZdZd�Zd�Zeddd�ej�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zy)�ListboxTest)�activestylerBrCrDr�r>rxryrErFrGrHr��listvariablerLrFrGrH�
selectmoder�r�rNrPrLr�c�B�tj|jfi|��Sr)rR�ListboxrTrUs  rrzListboxTest.create�r�rc�N�|j�}|j|dddd�y)Nr��dotboxrpr�r�r�s  r�test_configure_activestylez&ListboxTest.test_configure_activestyle�s&����������F�M�$�f�k�	;rrr�r}c��|j�}tj|j�}|j	|d|�y)Nr�)rrR�	DoubleVarrT�checkVariableParam)r&r'�vars   r�test_configure_listvariablez'ListboxTest.test_configure_listvariable�s3�����������	�	�*��������<rc��|j�}|j|dd�|j|dd�|j|dd�|j|dd�y)Nr��single�browse�multiple�extendedrer�s  r�test_configure_selectmodez%ListboxTest.test_configure_selectmode�sM������������h�7������h�7������j�9������j�9rc�L�|j�}|j|ddd�yrr�r�s  rriz ListboxTest.test_configure_state�rrc�L�|j�}|jtd�5|jd�ddd�dj	�}|j
dg|���t
|�D]\}}|j||���|jt�5|j�ddd�|jtd�5|jd�ddd�|j|jdd�d	�|j|jdd�d
�|j|jdd�d	�|jd�}|j|t�|j�D]v\}}|jt|�d�t|�d
k(s�0|j||jd|��|j|d|jd|���xy#1swY���xYw#1swY��^xYw#1swY��;xYw)Nzitem number "0" out of rangerz)red orange yellow green blue white violetrx)rBzbad listbox index "red"�redrB)rBrB�
Backgroundr,r�)rBrBr�r,�violetz@0,0)r�r}r}r�)rr6r�
itemconfigure�splitr��	enumeraterr�r r��dict�items�assertInr�rV)r&r'�colorsr��color�d�kr�s        r�test_itemconfigurezListboxTest.test_itemconfigure�s��������
�
#�
#�H�.L�
M�	$�� � ��#�	$�<�B�B�D����
�
�e�%�f�%�!�&�)�	6�H�A�u�� � ��u� �5�	6�
�
�
�y�
)�	#�� � �"�	#�
�
#�
#�H�.G�
H�	(�� � ��'�	(�����-�-�a��>�N�	P�����-�-�e�\�B�Q�	S�����-�-�f�l�C�N�	P�
� � ��#�����a��&��G�G�I�	>�D�A�q��M�M�#�a�&�&�)��1�v��{�� � ��F�$8�$8��A�$>�?�� � ��1��v���q�!�'<�=�		>�'	$�	$��	#�	#��	(�	(�s#�G?�H�H�?H	�H�H#c��|j�}|jddddd�|jd
i||i��|j|jd|�d|�|j|j	d|�|�|jtd�5|jd
i|d	i��ddd�y#1swYyxYw)Nrxr9r�r:rrr�zunknown color name "spam"r)r)rr�r�r rVr6r)r&r�r�r's    r�check_itemconfigurezListboxTest.check_itemconfigure�s���������
�
�e�S�#�s�C�0�����0�4��-�0�����-�-�a��6�q�9�5�A��������D�1�5�9�
�
#�
#�H�.I�
J�	6� �F� � �5�t�V�n�5�	6�	6�	6�s�B5�5B>c�(�|jdd�y)NrB�#ff0000�r
r7s r�test_itemconfigure_backgroundz)ListboxTest.test_itemconfigure_background���� � ��y�9rc�(�|jdd�y)N�bgrr
r7s r�test_itemconfigure_bgz!ListboxTest.test_itemconfigure_bg���� � ��y�1rc�(�|jdd�y)N�fg�#110022r
r7s r�test_itemconfigure_fgz!ListboxTest.test_itemconfigure_fgrrc�(�|jdd�y)Nryrr
r7s r�test_itemconfigure_foregroundz)ListboxTest.test_itemconfigure_foregroundrrc�(�|jdd�y)NrFrr
r7s r�#test_itemconfigure_selectbackgroundz/ListboxTest.test_itemconfigure_selectbackground���� � �!3�Y�?rc�(�|jdd�y)NrHz#654321r
r7s r�#test_itemconfigure_selectforegroundz/ListboxTest.test_itemconfigure_selectforegroundrrc�R�|j�}|jdgd�td�D����|j�|j	|jd��|j
|jd��|j
|jd��|jt|j
d�|jt|j
d�|jt|j
�|jt|j
dd�y)Nrc3�&K�|]	}d|z���y�w�zel%dNr?r�s  rr�z'ListboxTest.test_box.<locals>.<genexpr>�����4�a�v��z�4���rr�r�r�r3)
rr�r�r�r�r�r1rrr��r&�lbs  r�test_boxzListboxTest.test_boxs���
�[�[�]����	�	�!�5�4�5��8�4�5�
���	�� � ������,����"�'�'�"�+�&����"�'�'�"�+�&����(�B�G�G�Y�7����(�B�G�G�T�2����)�R�W�W�-����)�R�W�W�a��3rc�r�|j�}|jdgd�td�D����|jdtj
�|j
dd�|j
d�|j|j�d�|jt|jd�y)Nrc3�&K�|]	}d|z���y�wr!r?r�s  rr�z0ListboxTest.test_curselection.<locals>.<genexpr>"r"r#rr�r�r�)r�r#r�r�)rr�r�r�rR�END�
selection_setr �curselectionrr�r$s  r�test_curselectionzListboxTest.test_curselection s���
�[�[�]����	�	�!�5�4�5��8�4�5�
���1�g�k�k�*�
����A��
�����������*�L�9����)�R�_�_�a�8rc�T�|j�}|jdgd�td�D����|j|j	d�d�|j|j	d�d�|j|j	d�d�|j|j	d�d	�|j|j	d
�d	�|j|j	dd�d�|j|j	dd�d
�|j|j	dd�d�|j|j	dd�d�|jt|jd�|jt|jd�|jt|j�|jt|jdd�|jt|jddd�|jt|jd�y)Nrc3�&K�|]	}d|z���y�wr!r?r�s  rr�z'ListboxTest.test_get.<locals>.<genexpr>+r"r#r�el0r#�el3rx�el7r,r�r})r0�el4�el5)r3�el6r1r?)r/r�r3r�r>)rr�r�r r�rrr�r$s  r�test_getzListboxTest.test_get)s���
�[�[�]����	�	�!�5�4�5��8�4�5���������E�*���������E�*����������.���������B�'���������R�(��������1��'<�=��������5�)�+@�A��������1��r�*��������1��x�0����(�B�F�F�I�6����(�B�F�F�D�1����)�R�V�V�,����(�B�F�F�E�9�=����)�R�V�V�Q��1�5����(�B�F�F�C�0rN)r"r<r=rorr�rr�test_configure_justifyr�r�rirr
rrrrrrr&r,r5r?rrr�r��s{��	�G�4�;�
2�[��A�q�1�2F�2]�2]�^��=�
:�C�>�66�:�2�2�:�@�@�
4�9�1rr�c�\�eZdZdZdZd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zy)�	ScaleTest)r�rB�bigincrementrCr�rD�digitsrxryr�rFrGrHr��length�orientrLr�r��
resolution�	showvalue�sliderlength�sliderreliefr�rN�tickintervalr��troughcolorr�rP�verticalc�B�tj|jfi|��Sr)rR�ScalerTrUs  rrzScaleTest.createJrtrc�N�|j�}|j|dddd�y)Nr9g������(@g������7@rr�r�s  r�test_configure_bigincrementz%ScaleTest.test_configure_bigincrementMs#����������V�^�T�4��Drc�L�|j�}|j|ddd�y)Nr:r}rrr�s  r�test_configure_digitszScaleTest.test_configure_digitsQs!����������v�x��A�6rc��|j�}t|j�dk\rtnt}|j|dddd|��y)N)rr�r�r�r�������-@�333333.@r)rrrTrrr�)r&r'rs   rr�zScaleTest.test_configure_fromUs?�������)�$�)�)�4�
�B�u������V�V�S�$��4��Hrc�p�|j�}|j|dd�|j|dd�y)Nr�r�r,rer�s  r�test_configure_labelzScaleTest.test_configure_labelZs-�������������6�������,rc�P�|j�}|j|ddddd�y)Nr;�gffffff`@g33333�`@�5ir�r�s  r�test_configure_lengthzScaleTest.test_configure_length_s%����������f�h��U�E�4�Hrc�P�|j�}|j|ddddd�y)Nr=g������@rg������@r�r�r�s  r�test_configure_resolutionz#ScaleTest.test_configure_resolutioncs%����������V�\�3��3��Crc�H�|j�}|j|d�y)Nr>r�r�s  r�test_configure_showvaluez"ScaleTest.test_configure_showvaluegs����������v�{�3rc	�R�|j�}|j|dddddd�y)Nr?r�rO�333333/@r?�3mr�r�s  r�test_configure_sliderlengthz%ScaleTest.test_configure_sliderlengthks*����������f�n� �$��b�$�	8rc�H�|j�}|j|d�y)Nr@r�r�s  r�test_configure_sliderreliefz%ScaleTest.test_configure_sliderreliefpr�rc	��|j�}|j|dddddt��|j|dddt�	�y)
NrAr3�333333@rrrr�r�)r�r)rr�rr[r�s  r�test_configure_tickintervalz%ScaleTest.test_configure_tickintervaltsK����������V�^�Q��S�!�"-�	�	/�������Q�(�	�	*rc	�\�|j�}|j|dddddt��y)Nr�i,rKrLr�r)rr�rr�s  rr�zScaleTest.test_configure_to{s/����������V�T�3��d�C�"-�	�	/rN)r"r<r=ro�default_orientrrGrIr�rNrRrTrVrZr\r_r�r?rrr8r8=sP���G� �N�2�E�7�I�
-�
I�D�4�8�
6�*�/rr8c�@�eZdZdZeZdZdZd�Zd�Z	d�Z
d�Zd�Zd	�Z
y
)�
ScrollbarTest)r��activereliefrBrCr�rD�elementborderwidthrFrGrH�jumpr<rLr�r�rNrBrPTrCc�B�tj|jfi|��Sr)rR�	ScrollbarrTrUs  rrzScrollbarTest.create�s��� � ����5�f�5�5rc�H�|j�}|j|d�y)Nrdr�r�s  r�test_configure_activereliefz)ScrollbarTest.test_configure_activerelief�r�rc�P�|j�}|j|ddddd�y)Nrer^r%r��1mr�r�s  r�!test_configure_elementborderwidthz/ScrollbarTest.test_configure_elementborderwidth�s&����������f�&:�C��b�$�Orc�P�|j�}|j|dddd��y)Nr<rC�
horizontalz4bad orientation "{}": must be vertical or horizontalrr�r�s  r�test_configure_orientz#ScrollbarTest.test_configure_orient�s,����������F�H�j�,�M�	�	Orc�8�|j�}dD]3}|j|�|j|j�|��5|jd�|j|j��|j	t
|jdd�y)N)�arrow1�slider�arrow2r,rrrt)r�activater r1rr�)r&�sbr�s   r�
test_activatezScrollbarTest.test_activate�sv��
�[�[�]��/�	/�A��K�K��N����R�[�[�]�A�.�	/�	���B�����"�+�+�-�(����)�R�[�[�(�H�Erc���|j�}|jdd�|j|j�d�|j	t
|jdd�|j	t
|jdd�|j	t
|jdd�|j	t|jd�|j	t|jddd�y)	N皙�����?皙�����?)ryrz�abc�defg333333�?gffffff�?g�������?)rr�r r�rrr�)r&rvs  r�test_setzScrollbarTest.test_set�s���
�[�[�]��
���s�C���������:�.����(�B�F�F�E�5�9����(�B�F�F�C��7����(�B�F�F�C��6����)�R�V�V�S�1����)�R�V�V�S�#�s�;rN)r"r<r=rorr�r�rarrjrmrprwr}r?rrrcrc�s;���G��L��J��N�6�6�P�O�
F�<rrcc�
�eZdZdZdZd�Zd�Zd�Zd�Zd�Z	e
dd	d
�d��Ze
dd	d
�d��Ze
dd	d
�d
��Z
d�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd �Z d!�Z!y")#�PanedWindowTest)rBrCrD�	handlepad�
handlesizerE�opaqueresizer<�proxybackground�proxyborderwidth�proxyreliefrL�
sashcursor�sashpad�
sashrelief�	sashwidth�
showhandlerProc�B�tj|jfi|��Sr)rR�PanedWindowrTrUs  rrzPanedWindowTest.create�r�rc	�R�|j�}|j|dddddd�y)Nr�r}rrr?rlr�r�s  r�test_configure_handlepadz(PanedWindowTest.test_configure_handlepad�s'����������f�k�1�c�3��D�Irc
�V�|j�}|j|ddddddd��y)	Nr�rg������"@g333333%@r?�2mFrr�r�s  r�test_configure_handlesizez)PanedWindowTest.test_configure_handlesize�s1����������f�l�A�s�D�"�d�#(�	�	*rc�X�|j�}|j|dddddddd�	�	y)
NrErr�r�rrr Frr�r�s  rrz%PanedWindowTest.test_configure_height�s3����������f�h��U�E�4��D�#(�	�	*rc�H�|j�}|j|d�y)Nr�r�r�s  r�test_configure_opaqueresizez+PanedWindowTest.test_configure_opaqueresize�s����������v�~�6rrr�r}c�H�|j�}|j|d�y)Nr�rPr�s  r�test_configure_proxybackgroundz.PanedWindowTest.test_configure_proxybackground�s����������V�%6�7rc�X�|j�}|j|dddddddd�	�	y)
Nr�rr�g333333@r�r�r�Frr�r�s  r�test_configure_proxyborderwidthz/PanedWindowTest.test_configure_proxyborderwidth�s5����������f�&8���c�1�b�%�#(�	�	*rc�H�|j�}|j|d�y)Nr�r�r�s  r�test_configure_proxyreliefz*PanedWindowTest.test_configure_proxyrelief�s����������f�m�4rc�H�|j�}|j|d�y)Nr�r�r�s  r�test_configure_sashcursorz)PanedWindowTest.test_configure_sashcursor������������f�l�3rc	�R�|j�}|j|dddddd�y)Nr�rr�r�r�r�r�r�s  r�test_configure_sashpadz&PanedWindowTest.test_configure_sashpad�s'����������f�i��C��b�$�Grc�H�|j�}|j|d�y)Nr�r�r�s  r�test_configure_sashreliefz)PanedWindowTest.test_configure_sashrelief�r�rc
�V�|j�}|j|ddddddd��y)	Nr�r�g333333&@rXr?rlFrr�r�s  r�test_configure_sashwidthz(PanedWindowTest.test_configure_sashwidth�s1����������f�k�2�t�T�2�t�#(�	�	*rc�H�|j�}|j|d�y)Nr�r�r�s  r�test_configure_showhandlez)PanedWindowTest.test_configure_showhandle�s����������v�|�4rc�X�|j�}|j|dddddddd�	�	y)
NrPr-gfffff6y@g�����Iy@r.rrQFrr�r�s  rr/z$PanedWindowTest.test_configure_width�s3����������f�g�s�E�5�$��4�#(�	�	*rc���|j�}tj|�}tj|�}|j|�|j|�|||fSr)rrRr��add�r&�pr�r:s    r�create2zPanedWindowTest.create2sJ���K�K�M���N�N�1����N�N�1���	���a��	���a���!�Q�w�rc��|j�\}}}|jt|j�|j|�}|j	|t
�|j
�D]g\}}|jt|�d�|j||j||��|j|d|j||���iy)Nr}r�)
r�rr��
paneconfigurer�rrr r��panecget)r&r�r�r:rrr�s       r�test_paneconfigurez"PanedWindowTest.test_paneconfigure	s����,�,�.���1�a����)�Q�_�_�5�
�O�O�A������a��&��G�G�I�	5�D�A�q����S��V�Q�'����Q�����1� 5�6����Q�q�T�1�:�:�a��#3�4�	5rc���|jst|�}|j|fi||i��|j|j||�d|�|j|j	||�|�y)Nr�)r6r�r�r r�)r&r�r�r�r�r�s      r�check_paneconfigurez#PanedWindowTest.check_paneconfiguresf������8�}�H������+�d�E�]�+��������D�1�!�4�h�?�������A�t�,�h�7rc��|jt|�5|j|fi|di��ddd�y#1swYyxYw)N�badValue)r6rr�)r&r�r�r��msgs     r�check_paneconfigure_badz'PanedWindowTest.check_paneconfigure_bads?��
�
#�
#�H�c�
2�	5��A�O�O�A�4�$�
�!3�4�	5�	5�	5�s�6�?c	��|j�\}}}|j||d|t|��|j||dd�y)N�after�bad window path name "badValue"�r�r�r�r�r�s    r�test_paneconfigure_afterz(PanedWindowTest.test_paneconfigure_aftersE���,�,�.���1�a�� � ��A�w��3�q�6�:��$�$�Q��7�%F�	Hrc	��|j�\}}}|j||d|t|��|j||dd�y)N�beforer�r�r�s    r�test_paneconfigure_beforez)PanedWindowTest.test_paneconfigure_before$sE���,�,�.���1�a�� � ��A�x��C��F�;��$�$�Q��8�%F�	Hrc�~�|j�\}}}|j||ddd�|j||dd�y)NrEr��bad screen distance "badValue"�r�r�r�r�s    r�test_paneconfigure_heightz)PanedWindowTest.test_paneconfigure_height*sA���,�,�.���1�a�� � ��A�x��R�8��$�$�Q��8�%E�	Grc�~�|j�\}}}|j||ddd�|j||dd�y)N�hideFrz)expected boolean value but got "badValue"r�r�s    r�test_paneconfigure_hidez'PanedWindowTest.test_paneconfigure_hide0sA���,�,�.���1�a�� � ��A�v�u�a�8��$�$�Q��6�%P�	Rrc�~�|j�\}}}|j||ddd�|j||dd�y)N�minsizer�r�r�r�s    r�test_paneconfigure_minsizez*PanedWindowTest.test_paneconfigure_minsize6sA���,�,�.���1�a�� � ��A�y�"�b�9��$�$�Q��9�%E�	Grc�~�|j�\}}}|j||ddd�|j||dd�y)NrJr�r3r�r�r�s    r�test_paneconfigure_padxz'PanedWindowTest.test_paneconfigure_padx<�A���,�,�.���1�a�� � ��A�v�s�A�6��$�$�Q��6�%E�	Grc�~�|j�\}}}|j||ddd�|j||dd�y)NrKr�r3r�r�r�s    r�test_paneconfigure_padyz'PanedWindowTest.test_paneconfigure_padyBr�rc�~�|j�\}}}|j||ddd�|j||dd�y)N�sticky�nsew�neswz[bad stickyness value "badValue": must be a string containing zero or more of n, e, s, and wr�r�s    r�test_paneconfigure_stickyz)PanedWindowTest.test_paneconfigure_stickyHsB���,�,�.���1�a�� � ��A�x���@��$�$�Q��8�&6�	7rc�~�|j�\}}}|j||ddd�|j||dd�y)N�stretch�alw�alwayszEbad stretch "badValue": must be always, first, last, middle, or neverr�r�s    r�test_paneconfigure_stretchz*PanedWindowTest.test_paneconfigure_stretchPsD���,�,�.���1�a�� � ��A�y�%��B��$�$�Q��9�&M�	Nrc�~�|j�\}}}|j||ddd�|j||dd�y)NrPr�r�r�r�s    r�test_paneconfigure_widthz(PanedWindowTest.test_paneconfigure_widthWsA���,�,�.���1�a�� � ��A�w��B�7��$�$�Q��7�%E�	GrN)"r"r<r=rorarr�r�rr�rr�r�r�r�r�r�r�r�r/r�r�r�r�r�r�r�r�r�r�r�r�r�r�r?rrrr�s����G�"�N�8�J�*�
*�
7���A�q��8��8���A�q��*��*���A�q��5��5�4�H�4�*�
5�*�
�5�8�5�H�H�G�R�G�G�G�7�N�Grrc�P�eZdZdZdZd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zy
)�MenuTest)r��activeborderwidthr�rBrCrDr�rxry�postcommandrLr�rN�tearoff�tearoffcommandr#�typeFc�B�tj|jfi|��Sr)rRrZrTrUs  rrzMenuTest.createir�rc�h�|j�}|jd�}|j|�y)Nrp)r�indexr1)r&r'r�s   r�test_indexcommand_nonezMenuTest.test_indexcommand_nonels)��������L�L�� �����!�rc�H�|j�}|j|d�y)Nr�r]r�s  r�test_configure_postcommandz#MenuTest.test_configure_postcommandqr�rc�H�|j�}|j|d�y)Nr�r�r�s  r�test_configure_tearoffzMenuTest.test_configure_tearoffurCrc�H�|j�}|j|d�y)Nr�r]r�s  r�test_configure_tearoffcommandz&MenuTest.test_configure_tearoffcommandyr�rc�J�|j�}|j|dd�y)Nr#r�rer�s  r�test_configure_titlezMenuTest.test_configure_title}s�������������6rc	��|j�}|j�dkrdnd}|j|ddddd|z�	�y)
N)r�znormal, tearoff, or menubarzmenubar, normal, or tearoffr�r�r��menubarzbad type "{}": must be r)r�info_patchlevelr�)r&r'�optss   r�test_configure_typezMenuTest.test_configure_type�sT��������)�)�+�f�4�.�-�	
�	
����F��i��,�t�3�	�	rc��|j�}|jd��|jt|j�|jtd�5|j	d�ddd�|j	d�}|j|t�|j�D]�\}}|j|t�|j|t�|jt|�d�|j|d|�|j|jd|�|d���|j�y#1swY��xYw)	Nr��r�zbad menu entry index "foo"r�r3r}rr�)r�add_commandrr��entryconfigurer6rr�rrr��tupler r��	entrycgetr�)r&�m1rrr�s     r�test_entryconfigurezMenuTest.test_entryconfigure�s��
�[�[�]��
���V��$����)�R�%6�%6�7�
�
#�
#�H�.J�
K�	%����e�$�	%����a� �����a��&��G�G�I�	7�D�A�q��!�!�!�S�)��!�!�!�U�+����S��V�Q�'����Q�q�T�1�%����R�\�\�!�Q�/��1��6�	7�	�
�
��	%�	%�s�E�E
c��|j�}|jd��|j|jdd�d�|j	dd��|j|jdd�d�y)Nr�r�r3r��changed)rr�r r�r�)r&r�s  r�test_entryconfigure_labelz"MenuTest.test_entryconfigure_label�sd��
�[�[�]��
���V��$�������a��1�6�:�
���!�9��-�������a��1�9�=rc��|j�}tj|j�}tj|j�}|j	|ddd��|jt
|jdd��t
|��|jd|��|jt
|jdd��t
|��y)NTF�Nonsense)r�r�r�r�r3r�)r�)	rrR�
BooleanVarrT�add_checkbuttonr r�r�r�)r&r��v1�v2s    r�test_entryconfigure_variablez%MenuTest.test_entryconfigure_variable�s���
�[�[�]��
�
�
��	�	�
*��
�
�
��	�	�
*��
���B��u�!+�	�	-�����R�\�\�!�Z�8�9�3�r�7�C�
���!�b��)�����R�\�\�!�Z�8�9�3�r�7�CrN)r"r<r=ror�rr�r�r�r�r�r�r�r�rr?rrr�r�^sC���G��L�1��
6�2�9�7�	�� >�Drr�c� �eZdZdZdZd�Zd�Zy)�MessageTest)r��aspectrBrCrDrxryrFrGrHr�rJrKrLrNr|r�rPFc�B�tj|jfi|��Sr)rR�MessagerTrUs  rrzMessageTest.create�r�rc�N�|j�}|j|dddd�y)Nr�ri���rr�s  r�test_configure_aspectz!MessageTest.test_configure_aspect�s#����������v�x��a��>rN)r"r<r=ror>rrr?rrrr�s���G���4�?rrc��eZdZd�Zd�Zy)�DefaultRootTestc�B�|jtj�yr)�_test_widgetrRrsr7s r�
test_framezDefaultRootTest.test_frame�������'�-�-�(rc�B�|jtj�yr)rrRr�r7s r�
test_labelzDefaultRootTest.test_label�rrN)r"r<r=rrr?rrr
r
�s��)�)rr
�__main__),�unittestrRrrc�test.supportr�test.test_tkinter.supportrrrr�test.test_tkinter.widget_testsr	r
rrr
rr�TestCaserArqrwr�r�r�r�r�rr1r<r�r�r3r�r8rcrr�rr
�	tests_guir"�mainr?rr�<module>rs�����	�!�;�;�P�P�	����"7�-�~�"7�J�*�+�'2�'��):�):�'2�,�'2�T�*�+�	2�$�h�&7�&7�	2�,�	2��*�+��)�8�+<�+<��,��69�*�,<�9��*�+�2�!�8�#4�#4�2�,�2��*�+�O�"�H�$5�$5�O�,�O�(�*�+�3%�'��):�):�3%�,�3%�l�*�+�D�'��):�):�D�,�D�,�*�+�=H�&��(9�(9�=H�,�=H�@?�^�X�%6�%6�?��&�(<�=�X#�"�H�$5�$5�X#�>�X#�v�*�+�}C�)�X�.�.�}C�,�}C�@�*�+�C@�!�8�#4�#4�C@�,�C@�L�n�&:�;�z3�#�X�%6�%6�z3�<�z3�z�&�(<�=�B1�$�h�&7�&7�B1�>�B1�J�n�&:�;�@/�"�H�$5�$5�@/�<�@/�F�n�&:�;�/<�&��(9�(9�/<�<�/<�d�*�+�fG�(�(�*;�*;�fG�,�fG�R�*�+�LD�!�8�#4�#4�LD�,�LD�^�n�&:�;�?�$�h�&7�&7�?�<�?�$)�-�x�/@�/@�)�	�J����>�)�[���+�~���)�]��X�|�_�
�	��z���H�M�M�O�r