HEX
Server: Apache
System: Linux p3plzcpnl506847.prod.phx3.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: slfopp7cb1df (5698090)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //opt/python38/lib/python3.8/idlelib/idle_test/__pycache__/test_editmenu.cpython-38.pyc
U

�i�_
�@sjdZddlmZed�ddlZddlmZddlZddlmZGdd�dej	�Z
ed	krfejd
d�dS)zNTest (selected) IDLE Edit menu items.

Edit modules have their own test files
�)�requiresZguiN)�ttk)�pyshellc@s@eZdZdZedd��Zedd��Zdd�Zdd	�Zd
d�Z	dS)
�	PasteTestzeTest pasting into widgets that allow pasting.

    On X11, replacing selections requires tk fix.
    cCsht��|_}|j��t�|�t�|�|_t�|�|_	t
�|�|_t�|�|_
|��|�d�dS)N�two)�tkZTk�rootZwithdrawrZ
fix_x11_pasteZText�textZEntry�entryr�tentryZSpinbox�spin�clipboard_clearZclipboard_append)�clsr�r�>/opt/python38/lib/python3.8/idlelib/idle_test/test_editmenu.py�
setUpClasss

zPasteTest.setUpClasscCs2|`|`|`|j��|j��|j��|`dS)N)r	r
rrr
Zupdate_idletasksZdestroy)rrrr�
tearDownClasss



zPasteTest.tearDownClassc
Csj|j}dD]Z\}}|j||d��>|�dd�|�dd|�|�d�|�|�dd�|�W5QRXq
dS)z4Test pasting into text with and without a selection.))�zonetwo
)Zselztwo
)�tag�ansz1.0�end�one�	<<Paste>>N)r	�subTest�delete�insert�event_generate�assertEqual�get)�selfr	rrrrr�test_paste_text%s
zPasteTest.test_paste_textcCs~|j|jfD]l}dD]b\}}|j|||d��D|�dd�|�dd�|�d|�|�d�|�|��|�W5QRXqqdS)z8Test pasting into an entry with and without a selection.�)rZonetwo)rr)r
rrrrrrN)	r
rrrrZselect_rangerrr)rr
rrrrr�test_paste_entry/s
zPasteTest.test_paste_entryc
Csr|j}dD]b\}}|j||d��F|�dd�|�dd�|�dd|�|�d�|�|��|�W5QRXq
dS)	z9Test pasting into a spinbox with and without a selection.r!)rrrrr�rangerN)rrrrZ	selectionrrr)rrrrrrr�test_paste_spin<s
zPasteTest.test_paste_spinN)
�__name__�
__module__�__qualname__�__doc__�classmethodrrr r"r$rrrrrs



r�__main__�)�	verbosity)
r(Ztest.supportr�tkinterrrZunittestZidlelibrZTestCaserr%�mainrrrr�<module>s=