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/idlelib/idle_test/__pycache__/test_editmenu.cpython-312.pyc
�

}h�e
���dZddlmZed�ddlZddlmZddlZddlmZGd�dej�Z
ed	k(rejd
��yy)zNTest (selected) IDLE Edit menu items.

Edit modules have their own test files
�)�requires�guiN)�ttk)�pyshellc�B�eZdZdZed��Zed��Zd�Zd�Zd�Z	y)�	PasteTestzeTest pasting into widgets that allow pasting.

    On X11, replacing selections requires tk fix.
    c��tj�x|_}|jj�t	j
|�tj|�|_tj|�|_	tj|�|_tj|�|_
|j�|jd�y)N�two)�tk�Tk�root�withdrawr�
fix_x11_paste�Text�text�Entry�entryr�tentry�Spinbox�spin�clipboard_clear�clipboard_append)�clsr
s  �F/opt/alt/python312/lib64/python3.12/idlelib/idle_test/test_editmenu.py�
setUpClasszPasteTest.setUpClasss����%�%�'�!���4����������d�#��7�7�4�=����H�H�T�N��	��Y�Y�t�_��
��:�:�d�#����������e�$�c��|`|`|`|jj	�|jj�|jj
�|`y)N)rrrr
r�update_idletasks�destroy)rs r�
tearDownClasszPasteTest.tearDownClasssD���H�c�i������ � �"����!�!�#��������Hrc�0�|j}dD]y\}}|j||��5|jdd�|jdd|�|j	d�|j|j
dd�|�ddd��{y#1swY��xYw)z4Test pasting into text with and without a selection.))�zonetwo
)�selztwo
)�tag�ansz1.0�end�one�	<<Paste>>N)r�subTest�delete�insert�event_generate�assertEqual�get)�selfrr$r%s    r�test_paste_textzPasteTest.test_paste_text%s����y�y��:�	>�H�C�����#�3��/�
>����E�5�)����E�5�#�.��#�#�K�0�� � ����%��!7��=�	
>�
>�	>�
>�
>�s�AB�B	c�r�|j|jfD]�}dD]�\}}|j|||��5|jdd�|j	dd�|jd|�|j
d�|j|j�|�ddd�����y#1swY��xYw)z8Test pasting into an entry with and without a selection.�)r�onetwo)r&r
)rr&r%rr&r'r(N)	rrr)r*r+�select_ranger,r-r.)r/rr&r%s    r�test_paste_entryzPasteTest.test_paste_entry/s����Z�Z����,�	7�E�9�
7���S��\�\��3�C�\�@�7��L�L��E�*��L�L��E�*��&�&�q�#�.��(�(��5��$�$�U�Y�Y�[�#�6�7�7�
7�	7�7�7�s�A(B-�-B6c�P�|j}dD]�\}}|j||��5|jdd�|jdd�|j	dd|�|jd�|j
|j�|�ddd���y#1swY��xYw)	z9Test pasting into a spinbox with and without a selection.r2)r&r%rr&r'�ranger(N)rr)r*r+�	selectionr,r-r.)r/rr&r%s    r�test_paste_spinzPasteTest.test_paste_spin<s����y�y��5�	2�H�C�����#�3��/�
2����A�u�%����A�u�%����w��3�/��#�#�K�0�� � �����S�1�
2�
2�	2�
2�
2�s�A)B�B%	N)
�__name__�
__module__�__qualname__�__doc__�classmethodrr r0r5r9�rrrrs>����	%��	%�����>�7�
2rr�__main__�)�	verbosity)
r=�test.supportr�tkinterrr�unittest�idlelibr�TestCaserr:�mainr?rr�<module>rIsR���"��������:2��!�!�:2�z�z���H�M�M�A��r