
    ;e
                         d Z 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ej	                  Z
ed	k    r ej        d
           dS dS )zNTest (selected) IDLE Edit menu items.

Edit modules have their own test files
    )requiresguiN)ttk)pyshellc                   P    e Zd ZdZed             Zed             Zd Zd Zd Z	dS )	PasteTestzeTest pasting into widgets that allow pasting.

    On X11, replacing selections requires tk fix.
    c                    t          j                    x| _        }| j                                         t	          j        |           t          j        |          | _        t          j        |          | _	        t          j        |          | _        t          j        |          | _        |                                 |                    d           d S )Ntwo)tkTkrootwithdrawr   fix_x11_pasteTexttextEntryentryr   tentrySpinboxspinclipboard_clearclipboard_append)clsr   s     6/usr/lib/python3.11/idlelib/idle_test/test_editmenu.py
setUpClasszPasteTest.setUpClass   s    %''!4d###74==HTNN	Yt__
:d##e$$$$$    c                     | ` | `| `| j                                         | j                                         | j                                         | `d S )N)r   r   r   r   r   update_idletasksdestroy)r   s    r   tearDownClasszPasteTest.tearDownClass   sT    Hci  """!!###HHHr   c                 Z   | j         }dD ]\  }}|                     ||          5  |                    dd           |                    dd|           |                    d           |                     |                    dd          |           ddd           n# 1 swxY w Y   dS )z4Test pasting into text with and without a selection.)) zonetwo
)selztwo
)tagansz1.0endone	<<Paste>>N)r   subTestdeleteinsertevent_generateassertEqualget)selfr   r$   r%   s       r   test_paste_textzPasteTest.test_paste_text%   s    y: 	> 	>HC#3// > >E5)))E5#...##K000  %!7!7===	> > > > > > > > > > > > > > >	> 	>s   A-BB#	&B#	c                    | j         | j        fD ]}dD ]\  }}|                     |||          5  |                    dd           |                    dd           |                    d|           |                    d           |                     |                                |           ddd           n# 1 swxY w Y   dS )z8Test pasting into an entry with and without a selection.)r   onetwo)r&   r
   )r   r&   r%   r   r&   r'   r(   N)	r   r   r)   r*   r+   select_ranger,   r-   r.   )r/   r   r&   r%   s       r   test_paste_entryzPasteTest.test_paste_entry/   s    Z, 	7 	7E9 7 7S\\3C\@@ 7 7LLE***LLE***&&q#...((555$$UYY[[#6667 7 7 7 7 7 7 7 7 7 7 7 7 7 77	7 	7s   B B<<C C c                    | j         }dD ]\  }}|                     ||          5  |                    dd           |                    dd           |                    dd|           |                    d           |                     |                                |           ddd           n# 1 swxY w Y   dS )	z9Test pasting into a spinbox with and without a selection.r2   )r&   r%   r   r&   r'   ranger(   N)r   r)   r*   r+   	selectionr,   r-   r.   )r/   r   r&   r%   s       r   test_paste_spinzPasteTest.test_paste_spin<   s    y5 	2 	2HC#3// 2 2Au%%%Au%%%w3///##K000  S1112 2 2 2 2 2 2 2 2 2 2 2 2 2 2	2 	2s   BB33B7	:B7	N)
__name__
__module____qualname____doc__classmethodr   r    r0   r5   r9    r   r   r   r      s          	% 	% [	%   [> > >7 7 7
2 
2 
2 
2 
2r   r   __main__   )	verbosity)r=   test.supportr   tkinterr   r   unittestidlelibr   TestCaser   r:   mainr?   r   r   <module>rI      s     " ! ! ! ! !                  :2 :2 :2 :2 :2! :2 :2 :2z zHMA r   