Your IP : 18.116.98.210


Current Path : /opt/alt/python37/lib64/python3.7/idlelib/idle_test/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/idlelib/idle_test/__pycache__/test_editmenu.cpython-37.pyc

B

� f
�@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�D/opt/alt/python37/lib64/python3.7/idlelib/idle_test/test_editmenu.py�
setUpClasss

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


zPasteTest.tearDownClassc
Csn|j}xbdD]Z\}}|j||d��>|�dd�|�dd|�|�d�|�|�dd�|�WdQRXqWdS)z4Test pasting into text with and without a selection.))�zonetwo
)Zselztwo
)�tag�ansz1.0�end�onez	<<Paste>>N)r	�subTest�delete�insert�event_generate�assertEqual�get)�selfr	rrrrr�test_paste_text%s
zPasteTest.test_paste_textcCs�x�|j|jfD]p}xjdD]b\}}|j|||d��D|�dd�|�dd�|�d|�|�d�|�|��|�WdQRXqWqWdS)z8Test pasting into an entry with and without a selection.))r�onetwo)rr)r
rrrrrz	<<Paste>>N)	r
rrrrZselect_rangerrr)rr
rrrrr�test_paste_entry/s
zPasteTest.test_paste_entryc
Csv|j}xjdD]b\}}|j||d��F|�dd�|�dd�|�dd|�|�d�|�|��|�WdQRXqWdS)	z9Test pasting into a spinbox with and without a selection.))rr )rr)rrrrr�rangez	<<Paste>>N)rrrrZ	selectionrrr)rrrrrrr�test_paste_spin<s
zPasteTest.test_paste_spinN)
�__name__�
__module__�__qualname__�__doc__�classmethodrrrr!r#rrrrrs

r�__main__�)�	verbosity)
r'Ztest.supportrZtkinterrrZunittestZidlelibrZTestCaserr$�mainrrrr�<module>s=

?>