Your IP : 3.142.251.204


Current Path : /opt/alt/python36/lib64/python3.6/idlelib/idle_test/__pycache__/
Upload File :
Current File : //opt/alt/python36/lib64/python3.6/idlelib/idle_test/__pycache__/test_editmenu.cpython-36.pyc

3

� 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.
    cCshtj�|_}|jj�tj|�tj|�|_tj|�|_	t
j|�|_tj|�|_
|j�|jd�dS)N�two)�tkZTk�rootZwithdrawrZ
fix_x11_pasteZText�textZEntry�entryr�tentryZSpinbox�spin�clipboard_clearZclipboard_append)�clsr�r�D/opt/alt/python36/lib64/python3.6/idlelib/idle_test/test_editmenu.py�
setUpClasss

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


zPasteTest.tearDownClasscCsn|j}xbd
D]Z\}}|j||d��>|jdd�|jdd|�|jd	�|j|jdd�|�Wd
QRXqWd
S)z4Test pasting into text with and without a selection.��onetwo
�sel�two
)�tag�ansz1.0�end�onez	<<Paste>>N�rr�rr)rr)r	�subTest�delete�insert�event_generate�assertEqual�get)�selfr	rrrrr�test_paste_text%s
zPasteTest.test_paste_textcCs�x�|j|jfD]p}xjdD]b\}}|j|||d��D|jdd�|jdd�|jd|�|jd�|j|j�|�WdQRXqWqWdS)z8Test pasting into an entry with and without a selection.r�onetworr)r
rrrz	<<Paste>>N�rr%�rr)r&r')	r
rrrrZselect_ranger r!r")r#r
rrrrr�test_paste_entry/s
zPasteTest.test_paste_entrycCsv|j}xjdD]b\}}|j||d��F|jdd�|jdd�|jdd|�|jd�|j|j�|�Wd	QRXqWd	S)
z9Test pasting into a spinbox with and without a selection.rr%rr)rrr�rangez	<<Paste>>N�rr%�rr)r*r+)rrrrZ	selectionr r!r")r#rrrrrr�test_paste_spin<s
zPasteTest.test_paste_spinN)
�__name__�
__module__�__qualname__�__doc__�classmethodrrr$r(r,rrrrrs

r�__main__�)�	verbosity)
r0Ztest.supportrZtkinterrrZunittestZidlelibrZTestCaserr-�mainrrrr�<module>s=

?>