a
    åze
  ã                   @   sf   d dl mZ edƒ d dlZd dlmZ d dlZd dlmZ G dd„ dejƒZ	e
dkrbejd	d
 dS )é    )ÚrequiresZguiN)Úttk)Úpyshellc                   @   s<   e Zd Zedd„ ƒZedd„ ƒZdd„ Zdd„ Zd	d
„ ZdS )Ú	PasteTestc                 C   sh   t  ¡  | _}| j ¡  t |¡ t  |¡| _t  |¡| _	t
 |¡| _t  |¡| _| ¡  | d¡ d S )NÚtwo)ÚtkZTkÚrootZwithdrawr   Zfix_x11_pasteÚTextÚtextZEntryÚentryr   ÚtentryZSpinboxÚspinÚclipboard_clearZclipboard_append)Úclsr   © r   ú5/usr/lib/python3.9/idlelib/idle_test/test_editmenu.pyÚ
setUpClass   s    

zPasteTest.setUpClassc                 C   s2   | ` | `| `| j ¡  | j ¡  | j ¡  | `d S )N)r
   r   r   r   r   Zupdate_idletasksZdestroy)r   r   r   r   ÚtearDownClass   s
    


zPasteTest.tearDownClassc              	   C   s~   | j }dD ]n\}}| j||dH | dd¡ | dd|¡ | d¡ |  | dd¡|¡ W d   ƒ q
1 sn0    Y  q
d S )N))Ú zonetwo
)Zselztwo
)ÚtagÚansz1.0ÚendÚoneú	<<Paste>>)r
   ÚsubTestÚdeleteÚinsertÚevent_generateÚassertEqualÚget)Úselfr
   r   r   r   r   r   Útest_paste_text%   s    
zPasteTest.test_paste_textc              
   C   s’   | j | jfD ]€}dD ]v\}}| j|||dN | dd¡ | dd¡ | d|¡ | d¡ |  | ¡ |¡ W d   ƒ q1 s€0    Y  qqd S )N©)r   Zonetwo)r   r   )r   r   r   r   r   r   r   )	r   r   r   r   r   Zselect_ranger   r   r   )r    r   r   r   r   r   r   Útest_paste_entry/   s    
zPasteTest.test_paste_entryc              	   C   s†   | j }dD ]v\}}| j||dP | dd¡ | dd¡ | dd|¡ | d¡ |  | ¡ |¡ W d   ƒ q
1 sv0    Y  q
d S )Nr"   )r   r   r   r   r   Úranger   )r   r   r   r   Z	selectionr   r   r   )r    r   r   r   r   r   r   Útest_paste_spin<   s    
zPasteTest.test_paste_spinN)	Ú__name__Ú
__module__Ú__qualname__Úclassmethodr   r   r!   r#   r%   r   r   r   r   r      s   


r   Ú__main__é   )Ú	verbosity)Ztest.supportr   Útkinterr   r   ZunittestZidlelibr   ZTestCaser   r&   Úmainr   r   r   r   Ú<module>   s   =