Your IP : 3.147.6.122
��Yf� � @ s� d Z d d l m Z e d � d d l Z d d l Z d d l m Z Gd d � d e j � Z e
d k r} e j d d
� d S)zTTest (selected) IDLE Edit menu items.
Edit modules have their own test files files
� )�requiresZguiN)�PyShellc @ s^ e Z d Z d Z e d d � � Z e d d � � Z d d � Z d d � Z d
d � Z d S)
� PasteTestzeTest pasting into widgets that allow pasting.
On X11, replacing selections requires tk fix.
c C s{ t j � | _ } | j � t j | � t j | � | _ t j | � | _ t j
| � | _ | j � | j
d � d S)N�two)�tkZTk�rootZwithdrawr Z
fix_x11_pasteZText�textZEntry�entryZSpinbox�spin�clipboard_clearZclipboard_append)�clsr � r
�D/opt/alt/python35/lib64/python3.5/idlelib/idle_test/test_editmenu.py�
setUpClass s
zPasteTest.setUpClassc C sC | ` | ` | ` | j j � | j j � | j j � | ` d S)N)r r r
r r Zupdate_idletasksZdestroy)r r
r
r �
tearDownClass s
zPasteTest.tearDownClassc C s� | j } x� d D]x \ } } | j d | d | � �Q | j d d � | j d d | � | j d
� | j | j d d � | � Wd QRXq Wd S)z4Test pasting into text with and without a selection.� �onetwo
�sel�two
�tag�ansz1.0�end�onez <<Paste>>N�r r �r r )r r )r �subTest�delete�insert�event_generate�assertEqual�get)�selfr r r r
r
r �test_paste_text# s
zPasteTest.test_paste_textc C s� | j } x� d D]� \ } } | j d | d | d | � �X | j d d � | j d d � | j d | � | j d � | j | j � | � Wd QRXq Wd S)
z8Test pasting into an entry with and without a selection.r �onetwor r r r r z <<Paste>>N�r r# �r r )r$ r% )r r r r Zselect_ranger r r )r! r r r r
r
r �test_paste_entry- s
zPasteTest.test_paste_entryc C s� | j } x� d D]� \ } } | j d | d | � �[ | j d d � | j d d � | j d d | � | j d � | j | j � | � Wd QRXq Wd S)
z9Test pasting into a spinbox with and without a selection.r r# r r r r �rangez <<Paste>>N�r r# �r r )r( r) )r
r r r Z selectionr r r )r! r
r r r
r
r �test_paste_spin: s
zPasteTest.test_paste_spinN)
�__name__�
__module__�__qualname__�__doc__�classmethodr r r"