Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.12/test/test_tkinter/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.12/test/test_tkinter/__pycache__/test_misc.cpython-312.opt-2.pyc

�

)Μg����J�ddlZddlZddlZddlZddlmZddlmZmZejd�Gd�deej�ZGd�deej�ZGd	�d
eej�Z
Gd�deej�Zdd
�Zedk(rej"�yy)�N)�support)�AbstractTkTest�AbstractDefaultRootTest�guic�x�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zy)�MiscTestc��|jdtj�|jdtj�|jtj�|jdtj�|jdtj�|jdtj�|jdtj�|jdtj�y)N�Widget�CASCADE�re�sys�	constants�_tkerror�wantobjects)�assertIn�tkinter�__all__�assertIsNotNoner�assertNotIn)�selfs �8/usr/local/lib/python3.12/test/test_tkinter/test_misc.py�test_allzMiscTest.test_alls����
�
�h����0��
�
�i����1����W�_�_�-�����w���/��������0�����g�o�o�6�����W�_�_�5��������8�c��tj|jd��}tj|d��}|j	t|�d�y)N�top)�name�childz!<tkinter.Frame object .top.child>)r�Toplevel�root�Frame�assertEqual�repr)r�t�fs   r�	test_reprzMiscTest.test_reprs=�����T�Y�Y�U�3���M�M�!�'�*������a��"E�Frc�R�tj|j�}tj|�}tj|�}tj|�}t|�j
d�D],}|j|j�t|����.y)N�.)�msg)
rrrr �Button�str�split�assertFalse�isidentifierr")rr#r$�f2�brs      r�test_generated_nameszMiscTest.test_generated_namessw�����T�Y�Y�'���M�M�!���
�]�]�1�
���N�N�2�����F�L�L��%�D����T�.�.�0�d�4�j��A�&rc�\�|j}|jd�|j|dd�|jd�|j|dd�|jtj
d|jd�|jd��|j|dd�|jdd�	�|j|dd�|j|d
d�|jdd�	�|j|dd�|j|d
d�|jtj
d|jd��|jtj
d|jd��|jtj
d|jd�
�y)N�black�
background�whitez^unknown color name "spam"$�spam)r3�blue�yellow)r3�highlightColor�highlightcolorz!^must specify a background color$)r5)r8)r�
tk_setPaletter!�assertRaisesRegexr�TclError�rrs  r�test_tk_setPalettezMiscTest.test_tk_setPalette's����y�y�����7�#�����l�+�W�5����7�#�����l�+�W�5����w�/�/�-��"�"�F�	,�	
���g��.�����l�+�W�5����f�X��F�����l�+�V�4�����.�/��:����h�v��F�����l�+�X�6�����.�/��8����w�/�/�-��"�"�v�	�	7�	
���w�/�/�3��"�"��	�	2�	
���w�/�/�3��"�"�6�	�	;rc���|j}d
�fd�	}|j|jd��d�|jd|�}|j||jjdd��|jj
|jjdd|��\}}|j�|j�d�|jtj�5|jj|�ddd�d�|jd|dd�}|j�|j�d�|jd	|�}|j||jjdd��|jj
|jjdd|��\}}|j|�|j�d�|jtj�5|jj|�ddd�d�|jdtj|dd��}|j�|j�d�y#1swY��kxYw#1swY�bxYw)Nr�c���||z�y�N���start�step�counts  �r�callbackz%MiscTest.test_after.<locals>.callbackF�����D�L�Er�after�info�*��5i��rr@)r�assertIsNonerJr�tk�call�	splitlist�updater!�assertRaisesrr<�after_cancel�	functools�partial)rrrH�timer1�script�_rGs      @r�
test_afterzMiscTest.test_afterCs�����y�y��	!�
	
���$�*�*�Q�-�(������A�x�(���
�
�f�d�g�g�l�l�7�F�;�<��g�g�'�'������W�f�f�(M�N�������
������"�
�
�
�w�/�/�
0��G�G�L�L�� �1������A�x��R�0�����
������#����D�(�+���
�
�f�d�g�g�l�l�7�F�;�<��g�g�'�'������W�f�f�(M�N�������&�!������#�
�
�
�w�/�/�
0��G�G�L�L�� �1������A�y�0�0��2�r�B�C�����
������#�-1�
0��1�
0�s�.I3�J�3I=�J	c�<��|j}d	�fd�	}d�|j|�}|j||jj	dd��|jj|jj	dd|��\}}|j
�|j�d�|jtj�5|jj	|�ddd�d�|j|dd�}|j
�|j�d�|j|�}|j||jj	dd��|jj|jj	dd|��\}}|j|�|j�d�|jtj�5|jj	|�ddd�y#1swY��xYw#1swYyxYw)
Nrr@c���||z�yrBrCrDs  �rrHz*MiscTest.test_after_idle.<locals>.callbackorIrrJrKrLrMrNrO)r�
after_idlerrQrRrS�update_idletasksr!rUrr<rV)rrrH�idle1rZr[rGs      @r�test_after_idlezMiscTest.test_after_idlels�����y�y��	!�
������)���
�
�e�T�W�W�\�\�'�6�:�;��g�g�'�'������W�f�e�(L�M�������������"�
�
�
�w�/�/�
0��G�G�L�L�� �1�������"�b�1�����������#�����)���
�
�e�T�W�W�\�\�'�6�:�;��g�g�'�'������W�f�e�(L�M�������%� ������#�
�
�
�w�/�/�
0��G�G�L�L�� �1�
0�1�
0��1�
0�s�
H� H�H�Hc���|j}�fd�}|jd|�}|j|�}|jt�5|jd�ddd�d�|jj|jjdd|��\}}|jj|�|j�d�|j|�|jtj�5|jj|�ddd�|j�d�|jtj�5|jjdd|�ddd�|j|�d�|jj|jjdd|��\}}|jj|�|j�d�|j|�|jtj�5|jj|�ddd�|j�d�|jtj�5|jjdd|�ddd�y#1swY��BxYw#1swY���xYw#1swY��IxYw#1swY��xYw#1swYyxYw)Nc����dz
�y)Nr@rC)rGs�rrHz,MiscTest.test_after_cancel.<locals>.callback�s����Q�J�Eri�rrJrKr@)rrJr_rU�
ValueErrorrVrQrSrRr!rr<)rrrHrYrarZr[rGs       @r�test_after_cancelzMiscTest.test_after_cancel�s����y�y��	����D�(�+������)���
�
�z�
*����d�#�+����g�g�'�'������W�f�f�(M�N���������V�������"����&�!�
�
�
�w�/�/�
0��G�G�L�L�� �1������"�
�
�
�w�/�/�
0��G�G�L�L��&�&�1�1�	
���&�!����g�g�'�'������W�f�e�(L�M���������V�������"����%� �
�
�
�w�/�/�
0��G�G�L�L�� �1������"�
�
�
�w�/�/�
0��G�G�L�L��&�%�0�1�
0�7+�
*��1�
0��1�
0��1�
0��1�
0�s<�J�=J*�J7�!K�6K�J'�*J4�7K�K
�Kc��|j}|j�|jd�|j|j	�d�|jd�|j|j	�d�|j�|jtj�5|j	�ddd�y#1swYyxYw)NuÙñîuçōđěuÙñîçōđě�r�clipboard_clear�clipboard_appendr!�
clipboard_getrUrr<r=s  r�test_clipboardzMiscTest.test_clipboard�s����y�y���������h�'�����+�+�-�x�8����j�)�����+�+�-�/?�@�����
�
�
�w�/�/�
0���� �1�
0�
0���.C�Cc��|j}|j�|jd�|j|j	�d�|jd�|j|j	�d�|j�|jtj�5|j	�ddd�y#1swYyxYw)Nu𝔘𝔫𝔦u𝔠𝔬𝔡𝔢u𝔘𝔫𝔦𝔠𝔬𝔡𝔢rhr=s  r�test_clipboard_astralzMiscTest.test_clipboard_astral�s����y�y���������n�-�����+�+�-�~�>����0�1�����+�+�-�/M�N�����
�
�
�w�/�/�
0���� �1�
0�
0�rmc����fd�}�j}|j}�j|d�d��j|d�d��j|d�d�||d�d	�||d
�d��jtj
�5|d�ddd��jtj
�5|d
�ddd�y#1swY�:xYw#1swYyxYw)Nc�V��t||�D]\}}�j||d���y)N�!)�delta)�zip�assertAlmostEqual)�col1�col2�col1_channel�col2_channelrs    �r�assertApproxz-MiscTest.test_winfo_rgb.<locals>.assertApprox�s/���/2�$��o�*��l��&�&�|�\��&�L�/>r�red)�rrzdark slate blue)iHHi==i��z#F0F)r|rr|z#4a3c8c)iJJi<<i��z
#dede14143939)i��ii99z#123456789a)�o�N�7)r�	winfo_rgbr!rUrr<)rrzr�rgbs`   r�test_winfo_rgbzMiscTest.test_winfo_rgb�s����	M��y�y���n�n��	
����U��]�3�����.�/�1F�G�����V��&>�?��S��^�%=�>��S��)�+C�D�
�
�
�w�/�/�
0��
��1��
�
�w�/�/�
0��
��1�
0�1�
0��1�
0�s�$	C&�	C2�&C/�2C;c�n�tj|j�}tj|�}|j	�}|j|t�|j|jjt|��t|��|j|jjt|�d��t|��|j|jjt|�|��t|��|j|jj|�t|��|j|jj|d��t|��|j|jj||��t|��y)N)�	displayof)rrrr)�winfo_id�assertIsInstance�intr!�winfo_pathname�hexr*)rr#�w�wids    r�test_winfo_pathnamezMiscTest.test_winfo_pathname�s2�����T�Y�Y�'���N�N�1����j�j�l�����c�3�'�������1�1�#�c�(�;�S��V�D�������1�1�#�c�(�d�1�K�S�QR�V�T�������1�1�#�c�(�a�1�H�#�a�&�Q�������1�1�#�6��A��?�������1�1�#��1�F��A��O�������1�1�#��1�C�S��V�Lrc�P�tj�}d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
d|_d|_d|_d|_d|_|j't)|�d�y)N�90�??r��[��100z<100 event>)r�Event�serial�num�height�keycode�state�time�width�x�y�char�keysym�
keysym_num�type�widget�x_root�y_rootrsr!r"�r�es  r�test_event_repr_defaultsz!MiscTest.test_event_repr_defaults�s����M�M�O�������������	��������������������������������������������a��-�0rc��tj�}d|_d|_d|_d|_d|_d|_d|_d|_	d	|_
d
|_d|_d|_
d|_td�|_tj"j$|_d
|_d|_d|_d|_|j1t3|�d�y)Nr��T���Air�i,�
��AzKey-Az.texti�i����z�<Configure event send_event=True state=Shift|Control|Button3|0x30000 keysym=Key-A keycode=65 char='A' num=3 delta=-1 focus=True x=10 y=20 width=300 height=200>)rr�r�r��focusr�r�r�r�r�r�r�r��
send_eventr��ordr��	EventType�	Configurer�r�r�r�rsr!r"r�s  r�test_event_reprzMiscTest.test_event_reprs����M�M�O����������������	��������������������������3�x����"�"�,�,�������������������a��<�	=rc�~�Gd�dtj�}tj|tj�y)Nc��eZdZdZeZdZdZeZdZdZ	dZ
dZdZd	Z
d
ZdZdZd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!dZ"dZ#d Z$d!Z%d"Z&d#Z'd$Z(d%Z)y&)'�6MiscTest.test_eventtype_enum.<locals>.CheckedEventType�2�3�4�5�6�7�8�9�10�11�12�13�14�15�16�17�18�19�20�21�22�23�24�25�26�27�28�29�30�31�32�33�34�35�36�37�38N)*�__name__�
__module__�__qualname__�KeyPress�Key�
KeyRelease�ButtonPressr)�
ButtonRelease�Motion�Enter�Leave�FocusIn�FocusOut�Keymap�Expose�GraphicsExpose�NoExpose�
Visibility�Create�Destroy�Unmap�Map�
MapRequest�Reparentr��ConfigureRequest�Gravity�
ResizeRequest�	Circulate�CirculateRequest�Property�SelectionClear�SelectionRequest�	Selection�Colormap�
ClientMessage�Mapping�VirtualEvent�Activate�
Deactivate�
MouseWheelrCrr�CheckedEventTyper�$s����H��C��J��K� �F��M��F��E��E��G��H��F��F�!�N��H��J��F��G��E��C��J��H��I�#���G� �M��I�#���H�!�N�#���I��H� �M��G��L��H��J��Jrr)�enum�StrEnum�_test_simple_enumrr�)rrs  r�test_eventtype_enumzMiscTest.test_eventtype_enum#s,��'	�t�|�|�'	�P	
���/��1B�1B�Crc�$�dD]-}|j|jj|�d��/dD]-}|j|jj|�d��/|jt|jjd�|jt|jjd�|jt
|jjd�|jt
|jjd�y)N)�true�yes�on�1r#r�r@TT)�false�no�off�0r$�nrFF�year�rC)�assertIsr�
getbooleanrUre�	TypeError)r�vs  r�test_getbooleanzMiscTest.test_getbooleanNs���<�A��M�M�$�)�)�.�.�q�1�4�8�=�>�A��M�M�$�)�)�.�.�q�1�5�9�?����*�d�i�i�&:�&:�E�B����*�d�i�i�&:�&:�B�?����)�T�Y�Y�%9�%9�4�@����)�T�Y�Y�%9�%9�2�>rc�X���g���fd�}�jjd|��jjd��j�g��jjd��j�dg��j	�jj��y)Nc����jd��jjd�jj�y)Nr@�d)�appendrrJ�quit)�logrs��rrHz(MiscTest.test_mainloop.<locals>.callbackZs(����J�J�q�M��I�I�O�O�C������0rrr@r)rrJ�mainloopr!�
assertTrue�winfo_exists)rrHrs` @r�
test_mainloopzMiscTest.test_mainloopXs������	1�	
�	�	����X�&��	�	���1������b�!��	�	���1������q�c�"�����	�	�.�.�0�1rc��|jj�}tj|j�}|j	|j�|�|j|ddt�|j	t|�d�|j|dt�|j|dt�|j|dt�|j|dd�|j|dt�|j|jt�|j|jt�|j|jt�|j|jd�|j|jt�|j	|d|j�|j	|d|j�|j	|d|j�|j	|d|j�|j	|d|j�|j|d	kD�|jd
k(r|j	|jd�n|j	|jd�|jt!|�j#|j�d|j����y)N�rr@�r�)�alpha�beta�	candidate�final�)r'r(r*)r@rrr*r')r�info_patchlevelrr r!r��tuple�lenr�r�major�minor�micro�releaselevelr�r!r*�
startswith)r�vir$s   r�test_info_patchlevelzMiscTest.test_info_patchlevelds��
�Y�Y�
&�
&�
(���M�M�$�)�)�$������*�*�,�b�1����b��e�U�+�����R��!�$����b��e�S�)����b��e�S�)����b��e�S�)��
�
�b��e�D�E����b��e�S�)����b�h�h��,����b�h�h��,����b�h�h��,��
�
�b�o�o�'A�B����b�i�i��-�����A�����)�����A�����)�����A�����)�����A�����0�����A���	�	�*�����W��%�
�?�?�g�%����R�Y�Y��*����R�X�X�q�)�����B��*�*�b�h�h�Z�q����
�+C�D�Erc�R�tj|j�}|jdd�|j	dd�|j|j
�d�|jdd�|j	dd�|j|j
�d�y)Nrzabcdef�endu€u€abcdef)r�Entryr�insert�selection_ranger!�
selection_get)rr�s  r�test_embedded_nullzMiscTest.test_embedded_null�s������t�y�y�)���
�
�a��$����q�%�(�����-�-�/��>��
�
�a��$����q�%�(�����-�-�/�1E�FrN)r�r�r�rr%r0r>r\rbrfrlror�r�r�r�r	rr#r5r<rCrrrr
sf��9�G�
B�;�8'$�R!�@'1�R	!�	!��6
M�1�*=�8)D�V?�
2�F�:Grrc�<�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
y	)
�	EventTestc�6�tj|jdd��}|j�|jj	�|jj�g}|j
d|j�|j�|jj�|jt|�d|�|d}|j|jtjj�|j|j |�|j#|j$t&�|j|j(d�|j|j*d�|j-t/|d	��|j|j0d�|j|j2d�|j|j4d�|j|j6d�|j|j8d�|j|j:d�|j|j<d�|j|j>d�|j|j@d�|j|jBd�|j|jDd�|j|jFd�|j|jHd�|jtK|�d
�y)N�r�r�r�z	<FocusIn>r@rr�Fr�z<FocusIn event>)&rr r�pack�wait_visibilityr`�bindr�focus_forcerTr!r.rr�r�r�r�r�r�r�r�r�r,�hasattrr�r�r�r�r�r�r�r�r�r�r�r�rsr"�rr$�eventsr�s    r�
test_focuszEventTest.test_focus�s(���M�M�$�)�)�3�s�;��	�����	�	�!�!�#��	�	�"�"�$���	���{�F�M�M�*�	�
�
���	�	��������V��a��0��1�I���
�
�a�f�f�g�/�/�7�7�8��
�
�a�h�h��"����a�h�h��,��������&��
�
�a�l�l�E�*������G�,�-��������%�������$�'��������&�������D�)�������4�(�������t�,�������$�'�������4�(�������d�#�������d�#�������4�(�������4�(�������!�$�����a��"3�4rc��tj|jdd��}|j�|jj	�|jj�g}|j
d|j�|jdd��|jt|�d|�|d	}|j|jtjj�|j|j|�|j!|j"t$�|j|j&d
�|j|j(d�|j+t-|d��|j|j.d
�|j|j0d
�|j|j2d
�|j|j4d
�|j|j6d
�|j|j8d
�|j|j:d�|j|j<d�|j|j>d	�|j|j@d	�|j|jBd
�|j|jDd
�|j|jFd	�|jtI|�d
�y)Nr@rrAz<Configure>�xr�)r��borderwidthr@rr�Fr�z.<Configure event x=0 y=0 width=150 height=100>)%rr rrBrCr`rDr�	configurer!r.rr�r�r�r�r�r�r�r�r�r,rFr�r�r�r�r�r�r�r�r�r�r�r�rsr"rGs    r�test_configurezEventTest.test_configure�s���M�M�$�)�)�3�s�;��	�����	�	�!�!�#��	�	�"�"�$���	���}�f�m�m�,�	���3�B��/�����V��a��0��1�I���
�
�a�f�f�g�/�/�9�9�:��
�
�a�h�h��"����a�h�h��,��������&��
�
�a�l�l�E�*������G�,�-��������%�������$�'��������&�������D�)�������4�(�������t�,�������#�&�������3�'�������a� �������a� �������4�(�������4�(�������!�$�����a��"R�Src�f�tj|jdd��}|j�|jj	�|jj�g}|j
d|j�|j�|jd�|jt|�d|�|d}|j|jtjj�|j|j |�|j#|j$t&�|j|j(d�|j|j*d�|j-t/|d	��|j|j0d
�|j#|j2t&�|j5|j2d�|j|j6d�|j#|j8t&�|j5|j8d�|j|j:d�|j|j<t?d��|j|j@d
�|j|jBd
�|j|jDd|jG�z
�|j|jHd|jK�z
�|j|jLd�|j|jNd�|j|jPd�|jtS|�d
|j2d�d|j8�d|jD�d|jH�d�	�y)Nr@rrAz
<KeyPress>z<Alt-z>r@rFr�r��zr�z<KeyPress event state=z#xz keysym=z keycode=z char='z' x=z y=�>)*rr rrBrCr`rDrrE�event_generater!r.rr�r�r�r�r�r�r�r�r�r,rFr�r��assertNotEqualr�r�r�r�r�r�r�r��winfo_rootxr��winfo_rootyr�r�rsr"rGs    r�test_event_generate_key_pressz'EventTest.test_event_generate_key_press�s����M�M�$�)�)�3�s�;��	�����	�	�!�!�#��	�	�"�"�$���	���|�V�]�]�+�	�
�
��	����#�����V��a��0��1�I���
�
�a�f�f�g�/�/�8�8�9��
�
�a�h�h��"����a�h�h��,��������#��
�
�a�l�l�E�*������G�,�-��������%����a�g�g�s�+����A�G�G�Q�'��������%����a�i�i��-����A�I�I�q�)�������3�'�������s�3�x�0�������$�'�������4�(�������b�1�=�=�?�2�3�������b�1�=�=�?�2�3�������2�&�������2�&�������!�$�����a��$�Q�W�W�R�L�1 � !�	�	�{�,�q�s�s�e�3�q�s�s�e�1�
F�	Grc�P�tj|jdd��}|j�|jj	�|jj�g}|j
d|j�|jddd��|jt|�d|�|d}|j|jtjj�|j|j|�|j!|j"t$�|j|j&d�|j|j(d	�|j|j*d	�|j|j,d
�|j|j.d�|j|j0d
�|j|j2d
�|j|j4d
�|j|j6d
�|j|j8d
�|j|j:d
�|j|j<d�|j|j>d�|j|j@d|jC�z�|j|jDd|jG�z�|j|jHd�|jtK|�d�y)Nr@rrA�<Enter>�2�r�r�r@rFr�z$<Enter event focus=False x=100 y=50>)&rr rrBrCr`rDrrRr!r.rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rTr�rUrsr"rGs    r�test_event_generate_enterz#EventTest.test_event_generate_enter�s7���M�M�$�)�)�3�s�;��	�����	�	�!�!�#��	�	�"�"�$���	���y�&�-�-�(�	����c�R��0�����V��a��0��1�I���
�
�a�f�f�g�/�/�5�5�6��
�
�a�h�h��"����a�h�h��,��������#��
�
�a�l�l�E�*��
�
�a�g�g�u�%��������%�������!�$��������&�������D�)�������4�(�������t�,�������$�'�������4�(�������c�"�������b�!�������3�����#8�9�������2��
�
��#7�8�������!�$�����a��"H�Irc�n�tj|jdd��}|j�|jj	�|jj�g}|j
d|j�|j�|jddd��|jt|�d|�|d	}|j|jtjj�|j|j |�|j#|j$t&�|j|j(d	�|j|j*d
�|j-t/|d��|j|j0d�|j|j2d	�|j|j4d�|j|j6d�|j|j8d�|j|j:d�|j|j<d�|j|j>d�|j|j@d�|j|jBd�|j|jD|jG�dz�|j|jH|jK�dz�|j|jLd	�|jtO|�d
�y)Nr@rrAz
<ButtonPress>z
<Button-1>rYrZr@rFr�r�z$<ButtonPress event num=1 x=100 y=50>)(rr rrBrCr`rDrrErRr!r.rr�r�r�r�r�r�r�r�r�r,rFr�r�r�r�r�r�r�r�r�r�r�rTr�rUrsr"rGs    r� test_event_generate_button_pressz*EventTest.test_event_generate_button_presssC���M�M�$�)�)�3�s�;��	�����	�	�!�!�#��	�	�"�"�$���	�����
�
�.�	�
�
��	�������3�����V��a��0��1�I���
�
�a�f�f�g�/�/�;�;�<��
�
�a�h�h��"����a�h�h��,��������#��
�
�a�l�l�E�*������G�,�-��������"�������!�$��������&�������D�)�������4�(�������t�,�������$�'�������4�(�������c�"�������b�!�������1�=�=�?�S�#8�9�������1�=�=�?�R�#7�8�������!�$�����a��"H�Irc�n�tj|jdd��}|j�|jj	�|jj�g}|j
d|j�|j�|jddd��|jt|�d|�|d	}|j|jtjj�|j|j |�|j#|j$t&�|j|j(d	�|j|j*d
�|j-t/|d��|j|j0d�|j|j2d
�|j|j4d�|j|j6d�|j|j8d�|j|j:d�|j|j<d�|j|j>d�|j|j@d�|j|jBd�|j|jD|jG�dz�|j|jH|jK�dz�|j|jLd	�|jtO|�d�y)Nr@rrAz<Motion>z<B1-Motion>rYrZr@rFr�r��z'<Motion event state=Button1 x=100 y=50>)(rr rrBrCr`rDrrErRr!r.rr�r�r�r�r�r�r�r�r�r,rFr�r�r�r�r�r�r�r�r�r�r�rTr�rUrsr"rGs    r�test_event_generate_motionz$EventTest.test_event_generate_motion9sC���M�M�$�)�)�3�s�;��	�����	�	�!�!�#��	�	�"�"�$���	���z�6�=�=�)�	�
�
��	����#���4�����V��a��0��1�I���
�
�a�f�f�g�/�/�6�6�7��
�
�a�h�h��"����a�h�h��,��������#��
�
�a�l�l�E�*������G�,�-��������%�������%�(��������&�������D�)�������4�(�������t�,�������$�'�������4�(�������c�"�������b�!�������1�=�=�?�S�#8�9�������1�=�=�?�R�#7�8�������!�$�����a��"K�Lrc�p�tj|jdd��}|j�|jj	�|jj�g}|j
d|j�|j�|jdddd��|jt|�d|�|d	}|j|jtjj�|j|j |�|j#|j$t&�|j|j(d
�|j+t-|d��|j|j.d	�|j|j0d�|j|j2d	�|j|j4d�|j|j6d�|j|j8d�|j|j:d�|j|j<d�|j|j>d�|j|j@d�|j|jBd�|j|jD|jG�dz�|j|jH|jK�dz�|j|jLd�|jtO|�d
�y)Nr@rrAz<MouseWheel>rY���)r�r�rsr@rFr�r�z&<MouseWheel event delta=-5 x=100 y=50>)(rr rrBrCr`rDrrErRr!r.rr�r�rr�r�r�r�r�r,rFr�r�r�r�r�r�r�r�r�r�r�r�rTr�rUrsr"rGs    r�test_event_generate_mouse_wheelz)EventTest.test_event_generate_mouse_wheel[sE���M�M�$�)�)�3�s�;��	�����	�	�!�!�#��	�	�"�"�$���	���~�v�}�}�-�	�
�
��	����3�"�B��?�����V��a��0��1�I���
�
�a�f�f�g�/�/�:�:�;��
�
�a�h�h��"����a�h�h��,��
�
�a�l�l�E�*������G�,�-��������#��������%�������!�$��������&�������D�)�������4�(�������t�,�������$�'�������4�(�������c�"�������b�!�������1�=�=�?�S�#8�9�������1�=�=�?�R�#7�8�������"�%�����a��"J�Krc�J�tj|jdd��}|j�|jj	�|jj�g}|j
d|j�|j�|jdd��|jt|�d|�|d}|j|jtjj�|j|j |�|j#|j$t&�|j|j(d�|j|j*d	�|j-t/|d
��|j|j0d�|j|j2d�|j|j4d�|j|j6d�|j|j8d�|j|j:d�|j|j<d�|j|j>d�|j|j@d�|j|jBd�|j|jD|jG�dz�|j|jHd�|j|jJd�|jtM|�d
�y)Nr@rrAz<<Spam>>rY)r�r@rFr�r�r�z<VirtualEvent event x=50 y=0>)'rr rrBrCr`rDrrErRr!r.rr�r�rr�r�r�r�r�r�r,rFr�r�r�r�r�r�r�r�r�r�r�rTr�rsr"rGs    r�!test_generate_event_virtual_eventz+EventTest.test_generate_event_virtual_event}s8���M�M�$�)�)�3�s�;��	�����	�	�!�!�#��	�	�"�"�$���	���z�6�=�=�)�	�
�
��	����r��*�����V��a��0��1�I���
�
�a�f�f�g�/�/�<�<�=��
�
�a�h�h��"����a�h�h��,��������#��
�
�a�l�l�E�*������G�,�-��������%�������!�$��������&�������D�)�������4�(�������t�,�������$�'�������4�(�������b�!�������a� �������1�=�=�?�R�#7�8�������2�&�������!�$�����a��+�	.rN)r�r�r�rIrNrVr[r]r`rcrerCrrr>r>�s7�� 5�DT�B$G�LJ�B J�D M�D L�D!.rr>c���eZdZ�fd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z�xZS)�BindTestc���t�|��|j}tj|jddd��|_|j
j
�y)N�Testr@r��class_r�r�)�super�setUprrr �framerB)rr�	__class__s  �rrmzBindTest.setUp�s@���
��
���y�y���]�]�4�9�9�V�),�S�:��
��
�
���rc�R�|jt|j|�|f�yrB�r!�_info_commandsr�r�funcids  r�assertCommandExistzBindTest.assertCommandExist�s�������	�	�6�:�V�I�Frc�P�|jt|j|�d�y)NrCrqrss  r�assertCommandNotExistzBindTest.assertCommandNotExist�s�������	�	�6�:�B�?rc�R�d}|j}|j|j�d�|j|j|�d�d�}d�}|j||�}|j|j�|f�|j|�}|j||�|j	|�|j||d��}|j|�}|j||�|j||�|j	|�|j	|�y)N�<Control-Alt-Key-a>rCr�c��yrBrC�r�s r�test1z!BindTest.test_bind.<locals>.test1����drc��yrBrCr{s r�test2z!BindTest.test_bind.<locals>.test2�r}rT��add)rnr!rDrru)r�eventr$r|rrtrZ�funcid2s        r�	test_bindzBindTest.test_bind�s���%���J�J���������2�&����������+�������u�%���������E�8�,��������
�
�f�f�%�����'��&�&���4�&�0���������
�
�f�f�%��
�
�g�v�&�����'�����(rc���d}|j}|j|j�d�|j|j|�d�d�}d�}|j||�}|j||d��}|jt|j
�|j|�|j|j|�d�|j|j�d�y)N�<Control-Alt-Key-b>rCr�c��yrBrCr{s rr|z#BindTest.test_unbind.<locals>.test1�r}rc��yrBrCr{s rrz#BindTest.test_unbind.<locals>.test2�r}rTr�)rnr!rDrUr�unbind)rr�r$r|rrtr�s       r�test_unbindzBindTest.test_unbind�s���%���J�J���������2�&����������+�������u�%���&�&���4�&�0�����)�Q�X�X�.�	��������������+��������2�&rc�^�
�|j}|j�|j�|j�d}|j	|j�d�|j	|j|�d��
fd�}�
fd�}�
fd�}|j||�}|j||d��}|j||d��}g�
|j
|�|j	�
gd	��|j||�|j|�}	|j||	�|j||	�|j||	�|j	|j�|f�|j|�|j|�|j|�g�
|j
|�|j	�
d
dg�|j||�|j||�|j	|j|�d�|j	|j�d�|j|�|j|�|j|�g�
|j
|�|j	�
g�|jtj|j||�y)Nz<Control-Alt-Key-c>rCr�c�(���jd�y)N�a�r�r�rHs �rr|z$BindTest.test_unbind2.<locals>.test1�����f�m�m�C�(rc�(���jd�y)Nr/r�r�s �rrz$BindTest.test_unbind2.<locals>.test2�r�rc�(���jd�y)N�cr�r�s �r�test3z$BindTest.test_unbind2.<locals>.test3�r�rTr�)r�r/r�r�r�)rnrCrEr`r!rDrRr�rrrwrurUrr<)rr$r�r|rr�rtr��funcid3rZrHs          @r�test_unbind2zBindTest.test_unbind2�s+����J�J��	����	�
�
��	����%���������2�&����������+�(�(�(�����u�%���&�&���4�&�0���&�&���4�&�0����	����������1�	����� �����������&�)��
�
�f�f�%��
�
�g�v�&��������E�8�,��"�"�7�+�����'�����(���	���������#�s��,�	������	����� ����������+��������2�&��"�"�6�*��"�"�7�+��"�"�7�+���	����������$�	
���'�*�*�A�H�H�e�W�Erc��d}|j}|j|j�d�|j|j|�d�d�}d�}d�}|j||�}|j||d��}|j|�}|j||�|j||�|j	|�|j	|�|j||�}	|j|�}|j||�|j||�|j|	|�|j	|	�y)	N�<Control-Alt-Key-d>rCr�c��yrBrCr{s rr|z(BindTest.test_bind_rebind.<locals>.test1r}rc��yrBrCr{s rrz(BindTest.test_bind_rebind.<locals>.test2	r}rc��yrBrCr{s rr�z(BindTest.test_bind_rebind.<locals>.test3
r}rTr�)rnr!rDrrur)
rr�r$r|rr�rtr�rZr�s
          r�test_bind_rebindzBindTest.test_bind_rebinds	��%���J�J���������2�&����������+��������u�%���&�&���4�&�0���������
�
�g�v�&��
�
�f�f�%�����'�����(��&�&���&�������������(�����&�)��
�
�g�v�&�����(rc�t�d}|jj}|jj}|jt|�|j|d�d�|j|d|�d�|j
|d|�d�}d�}|d||�}|j|d�|f�|d|�}|j||�|j|�|d||d��}|d|�}|j||�|j||�|j|�|j|�y)	Nz<Control-Alt-Key-e>rirCr�c��yrBrCr{s rr|z'BindTest.test_bind_class.<locals>.test1#r}rc��yrBrCr{s rrz'BindTest.test_bind_class.<locals>.test2$r}rTr�)	r�
bind_class�unbind_classrUrr!�
addCleanuprru)	rr�r�r�r|rrtrZr�s	         r�test_bind_classzBindTest.test_bind_classs��%���Y�Y�)�)�
��y�y�-�-�����)�Z�0�����F�+�R�0�����F�E�2�B�7�����f�e�4����F�E�5�1������F�+�e�X�6��F�E�*���
�
�f�f�%�����'��V�U�E�t�<���F�E�*���
�
�f�f�%��
�
�g�v�&�����'�����(rc�D�d}|jj}|jj}|j|d�d�|j|d|�d�|j	|d|�d�}d�}|d||�}|d||d��}|jt|�|jt|d�|d|�|j|d|�d�|j|d�d�|j|�|j|�|d|�y)	Nz<Control-Alt-Key-f>rirCr�c��yrBrCr{s rr|z)BindTest.test_unbind_class.<locals>.test1:r}rc��yrBrCr{s rrz)BindTest.test_unbind_class.<locals>.test2;r}rTr�)rr�r�r!r�rUrru)rr�r�r�r|rrtr�s        r�test_unbind_classzBindTest.test_unbind_class3s��%���Y�Y�)�)�
��y�y�-�-������F�+�R�0�����F�E�2�B�7�����f�e�4����F�E�5�1���V�U�E�t�<�����)�\�2����)�\�6�:��V�U�#�����F�E�2�B�7�����F�+�R�0�����'�����(��V�U�#rc��d}|jj}|jj}|j|d�d�|j|d|�d�|j	|d|�d�}d�}d�}|d||�}|d||d�	�}|d|�}	|j||	�|j||	�|j
|�|j
|�|d||�}
|d|�}	|j||	�|j||	�|j|
|	�|j
|�|j
|�|j
|
�y)
Nz<Control-Alt-Key-g>rirCr�c��yrBrCr{s rr|z.BindTest.test_bind_class_rebind.<locals>.test1Qr}rc��yrBrCr{s rrz.BindTest.test_bind_class_rebind.<locals>.test2Rr}rc��yrBrCr{s rr�z.BindTest.test_bind_class_rebind.<locals>.test3Sr}rTr�)rr�r�r!r�rrur)rr�r�r�r|rr�rtr�rZr�s           r�test_bind_class_rebindzBindTest.test_bind_class_rebindJs>��%���Y�Y�)�)�
��y�y�-�-������F�+�R�0�����F�E�2�B�7�����f�e�4�����F�E�5�1���V�U�E�t�<���F�E�*���
�
�g�v�&��
�
�f�f�%�����'�����(��V�U�E�2���F�E�*�������(�����&�)��
�
�g�v�&�����'�����(�����(rc�6�d}|jj}|jj}|j||��|j	||�d�|j||�d�}d�}|||�}|j
||��||�}|j
||�|j|�|||d��}||�}|j
||�|j
||�|j|�|j|�y)Nz<Control-Alt-Key-h>r�c��yrBrCr{s rr|z%BindTest.test_bind_all.<locals>.test1mr}rc��yrBrCr{s rrz%BindTest.test_bind_all.<locals>.test2nr}rTr��r�bind_all�
unbind_allrr!r�rru)	rr�r�r�r|rrtrZr�s	         r�
test_bind_allzBindTest.test_bind_allfs���%���9�9�%�%���Y�Y�)�)�
������
�+�����%��"�-����
�E�*����%��'���
�
�e�X�Z�(��%����
�
�f�f�%�����'��5�%�T�2���%����
�
�f�f�%��
�
�g�v�&�����'�����(rc���d}|jj}|jj}|j||��|j	||�d�|j||�d�}d�}|||�}|||d��}||�|j	||�d�|j||��|j
|�|j
|�||�y)Nz<Control-Alt-Key-i>r�c��yrBrCr{s rr|z'BindTest.test_unbind_all.<locals>.test1�r}rc��yrBrCr{s rrz'BindTest.test_unbind_all.<locals>.test2�r}rTr�)rr�r�rr!r�ru)rr�r�r�r|rrtr�s        r�test_unbind_allzBindTest.test_unbind_all}s���%���9�9�%�%���Y�Y�)�)�
������
�+�����%��"�-����
�E�*����%��'���5�%�T�2���5������%��"�-������
�+�����'�����(��5�rc��d}|jj}|jj}|j||��|j	||�d�|j||�d�}d�}d�}|||�}|||d��}||�}	|j
||	�|j
||	�|j|�|j|�|||�}
||�}	|j||	�|j||	�|j
|
|	�|j|�|j|�|j|
�y)Nz<Control-Alt-Key-j>r�c��yrBrCr{s rr|z,BindTest.test_bind_all_rebind.<locals>.test1�r}rc��yrBrCr{s rrz,BindTest.test_bind_all_rebind.<locals>.test2�r}rc��yrBrCr{s rr�z,BindTest.test_bind_all_rebind.<locals>.test3�r}rTr�r�)rr�r�r�r|rr�rtr�rZr�s           r�test_bind_all_rebindzBindTest.test_bind_all_rebind�s*��%���9�9�%�%���Y�Y�)�)�
������
�+�����%��"�-����
�E�*�����%��'���5�%�T�2���%����
�
�g�v�&��
�
�f�f�%�����'�����(��5�%�(���%��������(�����&�)��
�
�g�v�&�����'�����(�����(rc�p�d}d}|j�|jt|j�t	|t
j�r|jn|j}t	|t
j�rC|jt|j|�|jt|j||�|j||�d�|j|||�d�d�}d�}|j|||�}|j||�|f�|||�}|j||�|j|�|j|||d��}	|||�}|j||�|j|	|�|j|�|j|	�y)	N�selryrCr�c��yrBrCr{s rr|z&BindTest._test_tag_bind.<locals>.test1�r}rc��yrBrCr{s rrz&BindTest._test_tag_bind.<locals>.test2�r}rTr�)rBrUr�tag_bind�
isinstancer�Text�	_tag_bindr!rru)
rr��tagr�r�r|rrtrZr�s
          r�_test_tag_bindzBindTest._test_tag_bind�s\����%��	�������)�Q�Z�Z�0�",�Q����"=�1�;�;�1�:�:���a����&����i����S�9����i����S�%�@�����#���+�����#�u�-�r�2������C���.������#����1��#�u�%���
�
�f�f�%�����'��*�*�S�%��D�*�9���#�u�%���
�
�f�f�%��
�
�g�v�&�����'�����(rc��d}d}|j�t|tj�r|jn|j
}|j
||�d�|j
|||�d�d�}d�}|j|||�}|j|||d��}|jt|j|�|j||�|j
|||�d�|j
||�d�y)	Nr�r�rCr�c��yrBrCr{s rr|z(BindTest._test_tag_unbind.<locals>.test1�r}rc��yrBrCr{s rrz(BindTest._test_tag_unbind.<locals>.test2�r}rTr�)
rBr�rr�r�r�r!rUr�
tag_unbind)	rr�r�r�r�r|rrtr�s	         r�_test_tag_unbindzBindTest._test_tag_unbind�s�����%��	����",�Q����"=�1�;�;�1�:�:������#���+�����#�u�-�r�2������C���.���*�*�S�%��D�*�9�����)�Q�\�\�3�7�	���S�%� �����#�u�-�r�2�����#���+rc��d}d}|j�t|tj�r|jn|j
}|j
||�d�|j
|||�d�d�}d�}d�}|j|||�}|j|||d�	�}	|||�}
|j|	|
�|j||
�|j|�|j|	�|j|||�}|||�}
|j||
�|j|	|
�|j||
�|j|�y)
Nr�r�rCr�c��yrBrCr{s rr|z-BindTest._test_tag_bind_rebind.<locals>.test1�r}rc��yrBrCr{s rrz-BindTest._test_tag_bind_rebind.<locals>.test2�r}rc��yrBrCr{s rr�z-BindTest._test_tag_bind_rebind.<locals>.test3�r}rTr�)
rBr�rr�r�r�r!rrur)rr�r�r�r�r|rr�rtr�rZr�s            r�_test_tag_bind_rebindzBindTest._test_tag_bind_rebind�s+����%��	����",�Q����"=�1�;�;�1�:�:������#���+�����#�u�-�r�2�������C���.���*�*�S�%��D�*�9���#�u�%���
�
�g�v�&��
�
�f�f�%�����'�����(��*�*�S�%��/���#�u�%�������(�����&�)��
�
�g�v�&�����(rc�d�tj|j�}|j|�yrB)r�Canvasrnr��rr�s  r�test_canvas_tag_bindzBindTest.test_canvas_tag_bind�s"���N�N�4�:�:�&�����A�rc�d�tj|j�}|j|�yrB)rr�rnr�r�s  r�test_canvas_tag_unbindzBindTest.test_canvas_tag_unbind�s"���N�N�4�:�:�&�����a� rc�d�tj|j�}|j|�yrB)rr�rnr�r�s  r�test_canvas_tag_bind_rebindz$BindTest.test_canvas_tag_bind_rebind�s"���N�N�4�:�:�&���"�"�1�%rc�d�tj|j�}|j|�yrB)rr�rnr��rr#s  r�test_text_tag_bindzBindTest.test_text_tag_binds"���L�L����$�����A�rc�d�tj|j�}|j|�yrB)rr�rnr�r�s  r�test_text_tag_unbindzBindTest.test_text_tag_unbinds"���L�L����$�����a� rc�d�tj|j�}|j|�yrB)rr�rnr�r�s  r�test_text_tag_bind_rebindz"BindTest.test_text_tag_bind_rebind	s"���L�L����$���"�"�1�%rc�,�|j}|j|jj�d�|j|j�t	|�dddf�|jd�|j|j�d�y)N)r'�Tk�allrir'r�)r�zb c)rnr!r�bindtagsr*)rr$s  r�
test_bindtagszBindTest.test_bindtags
sn���J�J��������+�+�-�/A�B���������A����U�'C�D�	�
�
�<� ��������|�4rc���d}|j}tj|�}tj|ddd��}|j	�|j�|j
�|j|jd|�|j|jd|�|j|jd|�|j|jd|�|j|j|��fd	�}|j||d
��|jd||d��|jd||d��|jd||d��|jd||d��|j||d
��|j||d��g�|j|�|j�d
|fd|fd|fd
|fg�g�|j|�|j�d|fd|fd
|fg�|jd�g�|j|�|j�d|fg�y)NrXrir@rrjrr��tag2c������fd�S)Nc�>���j�|jf�SrB)rr�)r�rH�whats ��r�<lambda>z9BindTest.test_bind_events.<locals>.test.<locals>.<lambda>"s���V�]�]�D�!�(�(�+;�<rrC)r�rHs`�r�testz'BindTest.test_bind_events.<locals>.test!s	���<�<rr�zframe classztoplevel classrn�toplevel)r��tag3)rrrr rBrCr`r�r�r�r�r�rDrRr!r�)rr�rr#r$r�rHs      @r�test_bind_eventszBindTest.test_bind_eventss
������y�y�����T�"���M�M�!�F�#�c�B��	����������������)�)�6�5�9�����)�)�:�u�=�����)�)�5�%�8�����)�)�6�5�9��������/�	=�	
�
�
�e�T�%�[�)������t�M�':�;����
�E�4�0@�+A�B�����u�d�5�k�2������t�F�|�4�	���u�d�7�m�$�	���u�d�:�&�'���	���������
�a�L�
�A��
��O�
�A�J�	"
�	���	���������
��O�
�q�!�
�A�J�"
�	�	
�
�
�?�#���	���������5�!�*��.r)r�r�r�rmrurwr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r��
__classcell__)ros@rrgrg�s����G�@�)�*'� ,F�\)�0)�0$�.)�8)�.�*)�8)�6,�$)�4�!�&��!�&�5�,/rrgc�$�eZdZd�Zd�Zd�Zd�Zy)�DefaultRootTestc�V�|jtjd�|jtj�tj
�}tj
�}tj
�}|jtj|�|j
�|jtj|�|j
�|jtj�|j
�|jtj�y)NT)rr�_support_default_rootrP�
_default_rootr��destroy)rr�root2�root3s    r�test_default_rootz!DefaultRootTest.test_default_rootEs����
�
�g�3�3�T�:����'�/�/�0��z�z�|���
�
����
�
����
�
�g�+�+�T�2�
�
�
���
�
�g�+�+�T�2��������'�/�/�0�
�
�
�����'�/�/�0rc��|jtjd�|jtj�tj
�}|jtj|�tj�|jtjd�|jttd��tj�|jtjd�|jttd��|j�|jtjd�|jttd��tj
�}|jtjd�|jttd��|j�y)NTFr�)
rrr�rPr�r��
NoDefaultRootr,rFr�r=s  r�test_no_default_rootz$DefaultRootTest.test_no_default_rootSs"���
�
�g�3�3�T�:����'�/�/�0��z�z�|���
�
�g�+�+�T�2������
�
�g�3�3�U�;������/�:�;������
�
�g�3�3�U�;������/�:�;������
�
�g�3�3�U�;������/�:�;��z�z�|���
�
�g�3�3�U�;������/�:�;����rc��|jttjd�tj�}|jtjd�d�|jttjd�|j�tj�|jttjd�y)NrTr)	rU�RuntimeErrorrrr�rrer�r�r=s  rrzDefaultRootTest.test_getbooleangs������,��(:�(:�C�@��z�z�|���
�
�g�(�(��-�t�4����*�g�&8�&8�%�@������������,��(:�(:�C�@rc�b�|jttj�tj�}|j|j�tj�|j�tj�|jttj�yrB)	rUr�rr r�r_rr�r�r=s  rr#zDefaultRootTest.test_mainlooppsj�����,��(8�(8�9��z�z�|������	�	�"����������������,��(8�(8�9rN)r�r�r�r�r�rr#rCrrr�r�Cs��1��(A�:rr�c�n�|jj|jjdd|��S)NrK�commands)rQrSrR)r��patterns  rrrrrzs(���9�9���v�y�y�~�~�f�j�'�J�K�Kr�__main__rB)rW�unittestrrr�r�test.test_tkinter.supportrr�requires�TestCaserr>rgr�rrr��mainrCrr�<module>rs��������M�������~G�~�x�0�0�~G�BS.��� 1� 1�S.�l_/�~�x�0�0�_/�D
4:�-�x�/@�/@�4:�nL��z���H�M�M�O�r

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