Your IP : 3.147.6.122


Current Path : /opt/alt/python35/lib64/python3.5/idlelib/idle_test/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/idlelib/idle_test/__pycache__/test_editmenu.cpython-35.pyc



��Yf�	�@s�dZddlmZed�ddlZddlZddlmZGdd�dej�Z	e
dkr}ejd	d
�dS)zTTest (selected) IDLE Edit menu items.

Edit modules have their own test files files
�)�requiresZguiN)�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.
    cCs{tj�|_}|j�tj|�tj|�|_tj|�|_	tj
|�|_|j�|j
d�dS)N�two)�tkZTk�rootZwithdrawrZ
fix_x11_pasteZText�textZEntry�entryZSpinbox�spin�clipboard_clearZclipboard_append)�clsr�r
�D/opt/alt/python35/lib64/python3.5/idlelib/idle_test/test_editmenu.py�
setUpClasss


zPasteTest.setUpClasscCsC|`|`|`|jj�|jj�|jj�|`dS)N)rr	r
rrZupdate_idletasksZdestroy)rr
r
r�
tearDownClasss



zPasteTest.tearDownClasscCs�|j}x�dD]x\}}|jd|d|��Q|jdd�|jdd	|�|jd
�|j|jdd�|�WdQRXqWdS)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)�selfrrrr
r
r�test_paste_text#s	
zPasteTest.test_paste_textcCs�|j}x�dD]�\}}|jd|d|d|��X|jdd�|jdd�|jd|�|jd�|j|j�|�Wd	QRXqWd	S)
z8Test pasting into an entry with and without a selection.r�onetworrr	rrz	<<Paste>>N�rr#�rr)r$r%)r	rrrZselect_rangerrr )r!r	rrr
r
r�test_paste_entry-s	
zPasteTest.test_paste_entrycCs�|j}x�dD]�\}}|jd|d|��[|jdd�|jdd�|jdd|�|jd�|j|j�|�Wd	QRXqWd	S)
z9Test pasting into a spinbox with and without a selection.rr#rrrr�rangez	<<Paste>>N�rr#�rr)r(r))r
rrrZ	selectionrrr )r!r
rrr
r
r�test_paste_spin:s	
zPasteTest.test_paste_spinN)
�__name__�
__module__�__qualname__�__doc__�classmethodrrr"r&r*r
r
r
rrs

r�__main__�	verbosity�)r.Ztest.supportrZtkinterrZunittestZidlelibrZTestCaserr+�mainr
r
r
r�<module>s
<

?>