
   tVZ                      d dl Z d dlZd dlZd dlZd dlmZ d dlmZmZ  ej	        d            G d deej
                  Z G d deej
                  Z G d	 d
eej
                  ZddZedk    r ej                     dS dS )    N)support)AbstractTkTestAbstractDefaultRootTestguic                   t    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd ZdS )MiscTestc                    |                      dt          j                   |                      dt          j                   |                     t          j                   |                     dt          j                   |                     dt          j                   |                     dt          j                   |                     dt          j                   |                     dt          j                   d S )NWidgetCASCADEresys	constants_tkerrorwantobjects)assertIntkinter__all__assertIsNotNoner   assertNotIn)selfs    q/nix/store/c6yb989sl77467xxwhylnkph1pqyi47p-python3-3.11.15/lib/python3.11/tkinter/test/test_tkinter/test_misc.pytest_allzMiscTest.test_all   s    h000i111W_---w///000go666W_55588888    c                     t          j        | j        d          }t          j        |d          }|                     t          |          d           d S )Ntop)namechildz!<tkinter.Frame object .top.child>)r   ToplevelrootFrameassertEqualrepr)r   tfs      r   	test_reprzMiscTest.test_repr   sP    TYU333M!'***a"EFFFFFr   c                 f   t          j        | j                  }t          j        |          }t          j        |          }t          j        |          }t          |                              d          D ]8}|                     |                                t          |                     9d S )N.)msg)
r   r   r   r    ButtonstrsplitassertFalseisidentifierr"   )r   r#   r$   f2br   s         r   test_generated_nameszMiscTest.test_generated_names   s    TY''M!]1N2FFLL%% 	B 	BDT..00d4jjAAAA	B 	Br   c                    | j         }|                    d           |                     |d         d           |                    d           |                     |d         d           |                     t          j        d|j        d           |                    d           |                     |d         d           |                    dd	           |                     |d         d           |                     |d
         d           |                    dd	           |                     |d         d           |                     |d
         d           |                     t          j        d|j        d           |                     t          j        d|j        d           |                     t          j        d|j        d           d S )Nblack
backgroundwhitez^unknown color name "spam"$spam)r3   blueyellow)r3   highlightColorhighlightcolorz!^must specify a background color$)r5   )r8   )r   tk_setPaletter!   assertRaisesRegexr   TclErrorr   r   s     r   test_tk_setPalettezMiscTest.test_tk_setPalette'   s   y7###l+W5557###l+W555w/-"F	, 	, 	, 	g...l+W555fXFFFl+V444./:::hvFFFl+X666./888w/-"v 	 	7 	7 	7 	w/3" 	 	2 	2 	2 	w/3"6 	 	; 	; 	; 	; 	;r   c                    | j         }d
fd	}|                     |                    d                     d|                    d|          }|                     ||j                            dd                     |j                            |j                            dd|                    \  }}|                                 |                     d           | 	                    t          j                  5  |j                            |           d d d            n# 1 swxY w Y   d|                    d|dd          }|                                 |                     d           |                    d	|          }|                     ||j                            dd                     |j                            |j                            dd|                    \  }}|                    |           |                     d           | 	                    t          j                  5  |j                            |           d d d            n# 1 swxY w Y   d|                    dt          j        |dd                    }|                                 |                     d           d S )Nr      c                     | |z   d S N startstepcounts     r   callbackz%MiscTest.test_after.<locals>.callbackF       DLEEEr   afterinfo*      5   i  r   r@   )r   assertIsNonerJ   r   tkcall	splitlistupdater!   assertRaisesr   r<   after_cancel	functoolspartial)r   r   rH   timer1script_rG   s         @r   
test_afterzMiscTest.test_afterC   s   y	! 	! 	! 	! 	! 	!
 	$**Q--((( Ax((fdgll7F;;<<<g''Wff(M(MNN"""w/00 	! 	!GLL   	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! AxR00### D(++fdgll7F;;<<<g''Wff(M(MNN&!!!###w/00 	! 	!GLL   	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! Ay02rBBCC#####s$   >D%%D),D):I!!I%(I%c                    | j         }d	fd	}d|                    |          }|                     ||j                            dd                     |j                            |j                            dd|                    \  }}|                                 |                     d           |                     t          j
                  5  |j                            |           d d d            n# 1 swxY w Y   d|                    |dd          }|                                 |                     d           |                    |          }|                     ||j                            dd                     |j                            |j                            dd|                    \  }}|                    |           |                     d           |                     t          j
                  5  |j                            |           d d d            d S # 1 swxY w Y   d S )
Nr   r@   c                     | |z   d S rB   rC   rD   s     r   rH   z*MiscTest.test_after_idle.<locals>.callbacko   rI   r   rJ   rK   rL   rM   rN   rO   )r   
after_idler   rQ   rR   rS   update_idletasksr!   rU   r   r<   rV   )r   r   rH   idle1rZ   r[   rG   s         @r   test_after_idlezMiscTest.test_after_idlel   s   y	! 	! 	! 	! 	! 	!
 ))eTW\\'6::;;;g''Wfe(L(LMM"""w/00 	! 	!GLL   	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! "b11### ))eTW\\'6::;;;g''Wfe(L(LMM%   ###w/00 	! 	!GLL   	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	!s$   C<<D D H77H;>H;c                    | j         }fd}|                    d|          }|                    |          }|                     t                    5  |                    d            d d d            n# 1 swxY w Y   d|j                            |j                            dd|                    \  }}|j                            |           | 	                    d           |                    |           |                     t          j                  5  |j                            |           d d d            n# 1 swxY w Y   | 	                    d           |                     t          j                  5  |j                            dd|           d d d            n# 1 swxY w Y   |                    |           d|j                            |j                            dd|                    \  }}|j                            |           | 	                    d           |                    |           |                     t          j                  5  |j                            |           d d d            n# 1 swxY w Y   | 	                    d           |                     t          j                  5  |j                            dd|           d d d            d S # 1 swxY w Y   d S )Nc                       dz   d S )Nr@   rC   )rG   s   r   rH   z,MiscTest.test_after_cancel.<locals>.callback   s    QJEEEr   i  r   rJ   rK   r@   )r   rJ   r_   rU   
ValueErrorrV   rQ   rS   rR   r!   r   r<   )r   r   rH   rY   ra   rZ   r[   rG   s          @r   test_after_cancelzMiscTest.test_after_cancel   s   y	 	 	 	 	 D(++)) z** 	$ 	$d###	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ g''Wff(M(MNNV"""&!!!w/00 	! 	!GLL   	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	!"""w/00 	2 	2GLL&&111	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	&!!! g''Wfe(L(LMMV"""%   w/00 	! 	!GLL   	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	!"""w/00 	1 	1GLL&%000	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1sZ   A55A9<A9EEEF--F14F1*JJJK;;K?K?c                    | j         }|                                 |                    d           |                     |                                d           |                    d           |                     |                                d           |                                 |                     t          j                  5  |                                 d d d            d S # 1 swxY w Y   d S )Nu   Ùñîu   çōđěu   Ùñîçōđěr   clipboard_clearclipboard_appendr!   clipboard_getrU   r   r<   r=   s     r   test_clipboardzMiscTest.test_clipboard   s'   yh'''++--x888j)))++--/?@@@w/00 	! 	!   	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	!   	C++C/2C/c                    | j         }|                                 |                    d           |                     |                                d           |                    d           |                     |                                d           |                                 |                     t          j                  5  |                                 d d d            d S # 1 swxY w Y   d S )Nu   𝔘𝔫𝔦u   𝔠𝔬𝔡𝔢u   𝔘𝔫𝔦𝔠𝔬𝔡𝔢rh   r=   s     r   test_clipboard_astralzMiscTest.test_clipboard_astral   s(   yn---++--~>>>0111++--/MNNNw/00 	! 	!   	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	!rm   c                 F     fd} j         }|j        }                      |d          d                                 |d          d                                 |d          d            | |d          d	            | |d
          d                                t          j                  5   |d           d d d            n# 1 swxY w Y                        t          j                  5   |d           d d d            d S # 1 swxY w Y   d S )Nc                 d    t          | |          D ]\  }}                    ||d           d S )N!   )delta)zipassertAlmostEqual)col1col2col1_channelcol2_channelr   s       r   assertApproxz-MiscTest.test_winfo_rgb.<locals>.assertApprox   sM     /2$oo M M*l&&|\&LLLLM Mr   red)  r   r   zdark slate blue)iHH  i==  i  z#F0F)r|   r   r|   z#4a3c8c)iJJ  i<<  i  z#dede14143939)i  i  i99  z#123456789a)o   N   7   )r   	winfo_rgbr!   rU   r   r<   )r   rz   r   rgbs   `   r   test_winfo_rgbzMiscTest.test_winfo_rgb   s   	M 	M 	M 	M 	M yn 	U]333.//1FGGGV&>???SS^^%=>>>SS))+CDDDw/00 	 	C	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 w/00 	 	C	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s$   ;CCC=DDDc                    t          j        | j                  }t          j        |          }|                                }|                     |t                     |                     | j                            t          |                    t          |                     |                     | j                            t          |          d           t          |                     |                     | j                            t          |          |          t          |                     |                     | j                            |          t          |                     |                     | j                            |d           t          |                     |                     | j                            ||          t          |                     d S )N)	displayof)r   r   r   r)   winfo_idassertIsInstanceintr!   winfo_pathnamehexr*   )r   r#   wwids       r   test_winfo_pathnamezMiscTest.test_winfo_pathname   s{   TY''N1jjllc3'''11#c((;;SVVDDD11#c((d1KKSQRVVTTT11#c((a1HH#a&&QQQ11#66A???11#1FFAOOO11#1CCSVVLLLLLr   c                 `   t          j                    }d|_        d|_        d|_        d|_        d|_        d|_        d|_        d|_	        d|_
        d|_        d|_        d|_        d|_        d|_        d|_        d|_        d|_        |                     t)          |          d           d S )N90  z??r   [ 100z<100 event>)r   Eventserialnumheightkeycodestatetimewidthxycharkeysym
keysym_numtypewidgetx_rooty_rootrs   r!   r"   r   es     r   test_event_repr_defaultsz!MiscTest.test_event_repr_defaults   s    MOO	a-00000r   c                    t          j                    }d|_        d|_        d|_        d|_        d|_        d|_        d|_        d|_	        d	|_
        d
|_        d|_        d|_        d|_        t          d          |_        t           j        j        |_        d|_        d|_        d|_        d|_        |                     t3          |          d           d S )Nr      T   A   i r   i,  
      AzKey-Az.texti  i  z<Configure event send_event=True state=Shift|Control|Button3|0x30000 keysym=Key-A keycode=65 char='A' num=3 delta=-1 focus=True x=10 y=20 width=300 height=200>)r   r   r   r   focusr   r   r   r   r   r   r   r   
send_eventr   ordr   	EventType	Configurer   r   r   r   rs   r!   r"   r   s     r   test_event_reprzMiscTest.test_event_repr  s    MOO	3xx",a<	= 	= 	= 	= 	=r   c                 t     G d dt           j                  }t          j        |t          j                   d S )Nc                       e Zd ZdZeZdZdZeZdZdZ	dZ
dZdZd	Zd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!dZ"dZ#d Z$d!Z%d"Z&d#Z'd$Z(d%Z)d&S )'6MiscTest.test_eventtype_enum.<locals>.CheckedEventType234567891011121314151617181920212223242526272829303132333435363738N)*__name__
__module____qualname__KeyPressKey
KeyReleaseButtonPressr)   ButtonReleaseMotionEnterLeaveFocusInFocusOutKeymapExposeGraphicsExposeNoExpose
VisibilityCreateDestroyUnmapMap
MapRequestReparentr   ConfigureRequestGravityResizeRequest	CirculateCirculateRequestPropertySelectionClearSelectionRequest	SelectionColormapClientMessageMappingVirtualEventActivate
Deactivate
MouseWheelrC   r   r   CheckedEventTyper   $  s        HCJK FMFEEGHFF!NHJFGECJHI#G MI#H!N#IH MGLHJJJJr   r  )enumStrEnum_test_simple_enumr   r   )r   r  s     r   test_eventtype_enumzMiscTest.test_eventtype_enum#  sN    '	 '	 '	 '	 '	t| '	 '	 '	P 	/1BCCCCCr   c                    dD ]0}|                      | j                            |          d           1dD ]0}|                      | j                            |          d           1|                     t          | j        j        d           |                     t          | j        j        d           |                     t
          | j        j        d            |                     t
          | j        j        d           d S )N)trueyeson1r#   r   r@   TT)falsenooff0r$   nr   FFyear   rC   )assertIsr   
getbooleanrU   re   	TypeError)r   vs     r   test_getbooleanzMiscTest.test_getbooleanN  s    < 	9 	9AMM$)..q1148888> 	: 	:AMM$)..q1159999*di&:EBBB*di&:B???)TY%94@@@)TY%92>>>>>r   c                 j    g  fd} j                             d|            j                             d                                g             j                             d                                dg                                 j                                                    d S )Nc                  |                          d           j                            dj        j                   d S )Nr@   d   )appendr   rJ   quit)logr   s   r   rH   z(MiscTest.test_mainloop.<locals>.callbackZ  s2    JJqMMMIOOC00000r   r  r@   r   )r   rJ   mainloopr!   
assertTruewinfo_exists)r   rH   r  s   ` @r   test_mainloopzMiscTest.test_mainloopX  s    	1 	1 	1 	1 	1 	1 		X&&&	1b!!!	1qc"""	..0011111r   c                 D   | j                                         }t          j        | j                   }|                     |                                |           |                     |d d          t                     |                     t          |          d           |                     |d         t                     |                     |d         t                     |                     |d         t                     | 	                    |d         d           |                     |d         t                     |                     |j
        t                     |                     |j        t                     |                     |j        t                     | 	                    |j        d           |                     |j        t                     |                     |d         |j
                   |                     |d         |j                   |                     |d         |j                   |                     |d         |j                   |                     |d         |j                   |                     |d	k               |j        d
k    r|                     |j        d           n|                     |j        d           |                     t!          |                              |j
         d|j                              d S )N   r   r@      r   )alphabeta	candidatefinal   )r&  r'  r)  )r@   r   r   r)  r'   )r   info_patchlevelr   r    r!   r   tuplelenr   r   majorminormicroreleaselevelr   r   r*   
startswith)r   vir$   s      r   test_info_patchlevelzMiscTest.test_info_patchleveld  s   Y&&((M$)$$**,,b111beU+++R!$$$beS)))beS)))beS)))beDEEEbeS)))bh,,,bh,,,bh,,,bo'ABBBbi---A)))A)))A)))A000A	***W%%%?g%%RY****RXq)))B**bh+C+C+C+CDDEEEEEr   N)r   r   r   r   r%   r0   r>   r\   rb   rf   rl   ro   r   r   r   r   r  r  r"  r4  rC   r   r   r   r   
   s(       9 9 9G G G
B B B; ; ;8'$ '$ '$R! ! !@'1 '1 '1R	! 	! 	!	! 	! 	!  6
M 
M 
M1 1 1*= = =8)D )D )DV? ? ?
2 
2 
2F F F F Fr   r   c                        e Zd Z fdZd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z xZS )BindTestc                     t                                                       | j        }t          j        | j        ddd          | _        | j                                         d S )NTest   r  class_r   r   )supersetUpr   r   r    framepack)r   r   	__class__s     r   r=  zBindTest.setUp  sV    y]49V),S: : :

r   c                 Z    |                      t          | j        |          |f           d S rB   r!   _info_commandsr   r   funcids     r   assertCommandExistzBindTest.assertCommandExist  s,    	6::VIFFFFFr   c                 X    |                      t          | j        |          d           d S )NrC   rB  rD  s     r   assertCommandNotExistzBindTest.assertCommandNotExist  s*    	6::B?????r   c                    d}| j         }|                     |                                d           |                     |                    |          d           d }d }|                    ||          }|                     |                                |f           |                    |          }|                     ||           |                     |           |                    ||d          }|                    |          }|                     ||           |                     ||           |                     |           |                     |           d S )N<Control-Alt-Key-a>rC   r   c                     d S rB   rC   r   s    r   test1z!BindTest.test_bind.<locals>.test1        r   c                     d S rB   rC   rL  s    r   test2z!BindTest.test_bind.<locals>.test2  rN  r   Tadd)r>  r!   bindr   rF  )r   eventr$   rM  rP  rE  rZ   funcid2s           r   	test_bindzBindTest.test_bind  sD   %J2&&&+++u%%E8,,,ff%%%'''&&4&00ff%%%gv&&&'''(((((r   c                 .   d}| j         }|                     |                                d           |                     |                    |          d           d }d }|                    ||          }|                    ||d          }|                     t          |j                   |                    |           |                     |                    |          d           |                     |                                d           d S )N<Control-Alt-Key-b>rC   r   c                     d S rB   rC   rL  s    r   rM  z#BindTest.test_unbind.<locals>.test1  rN  r   c                     d S rB   rC   rL  s    r   rP  z#BindTest.test_unbind.<locals>.test2  rN  r   TrQ  )r>  r!   rS  rU   r  unbind)r   rT  r$   rM  rP  rE  rU  s          r   test_unbindzBindTest.test_unbind  s    %J2&&&+++u%%&&4&00)QX...	+++2&&&&&r   c                 d  
 | j         }|                                 |                                 |                                 d}|                     |                                d           |                     |                    |          d           
fd}
fd}
fd}|                    ||          }|                    ||d          }|                    ||d          }g 
|                    |           |                     
g d	           |                    ||           |                    |          }	|                     ||	           | 	                    ||	           | 	                    ||	           |                     |                                |f           | 
                    |           |                     |           |                     |           g 
|                    |           |                     
d
dg           |                    ||           |                    ||           |                     |                    |          d           |                     |                                d           | 
                    |           | 
                    |           | 
                    |           g 
|                    |           |                     
g            |                     t          j        |j        ||           d S )Nz<Control-Alt-Key-c>rC   r   c                 2                         d           d S )Nar  r   eventss    r   rM  z$BindTest.test_unbind2.<locals>.test1      fmmC(((((r   c                 2                         d           d S )Nr/   r`  ra  s    r   rP  z$BindTest.test_unbind2.<locals>.test2  rc  r   c                 2                         d           d S )Ncr`  ra  s    r   test3z$BindTest.test_unbind2.<locals>.test3  rc  r   TrQ  )r_  r/   rf  r_  rf  )r>  wait_visibilityfocus_forcer`   r!   rS  event_generater[  r   r   rH  rF  rU   r   r<   )r   r$   rT  rM  rP  rg  rE  rU  funcid3rZ   rb  s             @r   test_unbind2zBindTest.test_unbind2  s   J			%2&&&+++(((((((((((((((u%%&&4&00&&4&00	111	   &)))ff%%%gv&&&E8,,,""7+++'''(((	#s,,,		   +++2&&&""6***""7+++""7+++	$$$ 	'*AHeWEEEEEr   c                    d}| j         }|                     |                                d           |                     |                    |          d           d }d }d }|                    ||          }|                    ||d          }|                    |          }|                     ||           |                     ||           |                     |           |                     |           |                    ||          }	|                    |          }|                     ||           |                     ||           |                     |	|           |                     |	           d S )	N<Control-Alt-Key-d>rC   r   c                     d S rB   rC   rL  s    r   rM  z(BindTest.test_bind_rebind.<locals>.test1  rN  r   c                     d S rB   rC   rL  s    r   rP  z(BindTest.test_bind_rebind.<locals>.test2  rN  r   c                     d S rB   rC   rL  s    r   rg  z(BindTest.test_bind_rebind.<locals>.test3  rN  r   TrQ  )r>  r!   rS  r   rF  r   )
r   rT  r$   rM  rP  rg  rE  rU  rZ   rk  s
             r   test_bind_rebindzBindTest.test_bind_rebind  sl   %J2&&&+++u%%&&4&00gv&&&ff%%%'''(((&&&&(((&)))gv&&&(((((r   c                    d}| j         j        }| j         j        }|                     t          |           |                      |d          d           |                      |d|          d           |                     |d|           d }d } |d||          }|                      |d          |f            |d|          }|                     ||           |                     |            |d||d          } |d|          }|                     ||           |                     ||           |                     |           |                     |           d S )	Nz<Control-Alt-Key-e>r8  rC   r   c                     d S rB   rC   rL  s    r   rM  z'BindTest.test_bind_class.<locals>.test1  rN  r   c                     d S rB   rC   rL  s    r   rP  z'BindTest.test_bind_class.<locals>.test2  rN  r   TrQ  )	r   
bind_classunbind_classrU   r  r!   
addCleanupr   rF  )	r   rT  rv  rw  rM  rP  rE  rZ   rU  s	            r   test_bind_classzBindTest.test_bind_class  s   %Y)
y-)Z000F++R000FE22B777fe444FE511F++eX666FE**ff%%%'''*VUEt<<<FE**ff%%%gv&&&'''(((((r   c                    d}| j         j        }| j         j        }|                      |d          d           |                      |d|          d           |                     |d|           d }d } |d||          } |d||d          }|                     t          |           |                     t          |d            |d|           |                      |d|          d           |                      |d          d           |                     |           |                     |            |d|           d S )	Nz<Control-Alt-Key-f>r8  rC   r   c                     d S rB   rC   rL  s    r   rM  z)BindTest.test_unbind_class.<locals>.test1  rN  r   c                     d S rB   rC   rL  s    r   rP  z)BindTest.test_unbind_class.<locals>.test2  rN  r   TrQ  )r   rv  rw  r!   rx  rU   r  rF  )r   rT  rv  rw  rM  rP  rE  rU  s           r   test_unbind_classzBindTest.test_unbind_class  sr   %Y)
y-F++R000FE22B777fe444FE511*VUEt<<<)\222)\6:::VU###FE22B777F++R000'''(((VU#####r   c                 (   d}| j         j        }| j         j        }|                      |d          d           |                      |d|          d           |                     |d|           d }d }d } |d||          } |d||d	          } |d|          }	|                     ||	           |                     ||	           |                     |           |                     |            |d||          }
 |d|          }	|                     ||	           |                     ||	           |                     |
|	           |                     |           |                     |           |                     |
           d S )
Nz<Control-Alt-Key-g>r8  rC   r   c                     d S rB   rC   rL  s    r   rM  z.BindTest.test_bind_class_rebind.<locals>.test12  rN  r   c                     d S rB   rC   rL  s    r   rP  z.BindTest.test_bind_class_rebind.<locals>.test23  rN  r   c                     d S rB   rC   rL  s    r   rg  z.BindTest.test_bind_class_rebind.<locals>.test34  rN  r   TrQ  )r   rv  rw  r!   rx  r   rF  r   )r   rT  rv  rw  rM  rP  rg  rE  rU  rZ   rk  s              r   test_bind_class_rebindzBindTest.test_bind_class_rebind+  s   %Y)
y-F++R000FE22B777fe444FE511*VUEt<<<FE**gv&&&ff%%%'''(((*VUE22FE**(((&)))gv&&&'''((((((((r   c                    d}| j         j        }| j         j        }|                     | |                       |                      ||          d           |                     ||           d }d } |||          }|                     | |                        ||          }|                     ||           |                     |            |||d          } ||          }|                     ||           |                     ||           |                     |           |                     |           d S )Nz<Control-Alt-Key-h>r   c                     d S rB   rC   rL  s    r   rM  z%BindTest.test_bind_all.<locals>.test1N  rN  r   c                     d S rB   rC   rL  s    r   rP  z%BindTest.test_bind_all.<locals>.test2O  rN  r   TrQ  r   bind_all
unbind_allr   r!   rx  r   rF  )	r   rT  r  r  rM  rP  rE  rZ   rU  s	            r   test_bind_allzBindTest.test_bind_allG  sT   %9%Y)


+++%"---
E***%''eXXZZ(((%ff%%%'''(5%T222%ff%%%gv&&&'''(((((r   c                    d}| j         j        }| j         j        }|                     | |                       |                      ||          d           |                     ||           d }d } |||          } |||d          } ||           |                      ||          d           |                     | |                       |                     |           |                     |            ||           d S )Nz<Control-Alt-Key-i>r   c                     d S rB   rC   rL  s    r   rM  z'BindTest.test_unbind_all.<locals>.test1e  rN  r   c                     d S rB   rC   rL  s    r   rP  z'BindTest.test_unbind_all.<locals>.test2f  rN  r   TrQ  )r   r  r  r   r!   rx  rF  )r   rT  r  r  rM  rP  rE  rU  s           r   test_unbind_allzBindTest.test_unbind_all^  s*   %9%Y)


+++%"---
E***%''(5%T222
5%"---

+++'''(((
5r   c                    d}| j         j        }| j         j        }|                     | |                       |                      ||          d           |                     ||           d }d }d } |||          } |||d          } ||          }	|                     ||	           |                     ||	           |                     |           |                     |            |||          }
 ||          }	|                     ||	           |                     ||	           |                     |
|	           |                     |           |                     |           |                     |
           d S )Nz<Control-Alt-Key-j>r   c                     d S rB   rC   rL  s    r   rM  z,BindTest.test_bind_all_rebind.<locals>.test1z  rN  r   c                     d S rB   rC   rL  s    r   rP  z,BindTest.test_bind_all_rebind.<locals>.test2{  rN  r   c                     d S rB   rC   rL  s    r   rg  z,BindTest.test_bind_all_rebind.<locals>.test3|  rN  r   TrQ  r  )r   rT  r  r  rM  rP  rg  rE  rU  rZ   rk  s              r   test_bind_all_rebindzBindTest.test_bind_all_rebinds  s   %9%Y)


+++%"---
E***%''(5%T222%gv&&&ff%%%'''((((5%((%(((&)))gv&&&'''((((((((r   c                    d}d}|                                  |                     t          |j                   t	          |t
          j                  r|j        n|j        }t	          |t
          j                  rC|                     t          |j        |           |                     t          |j        ||           |                      ||          d           |                      |||          d           d }d }|                    |||          }|                      ||          |f            |||          }| 	                    ||           | 
                    |           |                    |||d          }	 |||          }| 	                    ||           | 	                    |	|           | 
                    |           | 
                    |	           d S )	NselrJ  rC   r   c                     d S rB   rC   rL  s    r   rM  z&BindTest._test_tag_bind.<locals>.test1  rN  r   c                     d S rB   rC   rL  s    r   rP  z&BindTest._test_tag_bind.<locals>.test2  rN  r   TrQ  )r?  rU   r  tag_bind
isinstancer   Text	_tag_bindr!   r   rF  )
r   r   tagrT  r  rM  rP  rE  rZ   rU  s
             r   _test_tag_bindzBindTest._test_tag_bind  s   %	)QZ000",Q"="=M1;;1:a&& 	AiS999iS%@@@#+++#u--r222C..#111#u%%ff%%%'''**S%D*99#u%%ff%%%gv&&&'''(((((r   c                 \   d}d}|                                  t          |t          j                  r|j        n|j        }|                      ||          d           |                      |||          d           d }d }|                    |||          }|                    |||d          }|                     t          |j	        |           |	                    ||           |                      |||          d           |                      ||          d           d S )	Nr  rX  rC   r   c                     d S rB   rC   rL  s    r   rM  z(BindTest._test_tag_unbind.<locals>.test1  rN  r   c                     d S rB   rC   rL  s    r   rP  z(BindTest._test_tag_unbind.<locals>.test2  rN  r   TrQ  )
r?  r  r   r  r  r  r!   rU   r  
tag_unbind)	r   r   r  rT  r  rM  rP  rE  rU  s	            r   _test_tag_unbindzBindTest._test_tag_unbind  s+   %	",Q"="=M1;;1:#+++#u--r222C..**S%D*99)Q\3777	S%   #u--r222#+++++r   c                 .   d}d}|                                  t          |t          j                  r|j        n|j        }|                      ||          d           |                      |||          d           d }d }d }|                    |||          }|                    |||d	          }	 |||          }
|                     |	|
           |                     ||
           |                     |           |                     |	           |                    |||          } |||          }
| 	                    ||
           | 	                    |	|
           |                     ||
           |                     |           d S )
Nr  rn  rC   r   c                     d S rB   rC   rL  s    r   rM  z-BindTest._test_tag_bind_rebind.<locals>.test1  rN  r   c                     d S rB   rC   rL  s    r   rP  z-BindTest._test_tag_bind_rebind.<locals>.test2  rN  r   c                     d S rB   rC   rL  s    r   rg  z-BindTest._test_tag_bind_rebind.<locals>.test3  rN  r   TrQ  )
r?  r  r   r  r  r  r!   r   rF  r   )r   r   r  rT  r  rM  rP  rg  rE  rU  rZ   rk  s               r   _test_tag_bind_rebindzBindTest._test_tag_bind_rebind  s   %	",Q"="=M1;;1:#+++#u--r222C..**S%D*99#u%%gv&&&ff%%%'''(((**S%//#u%%(((&)))gv&&&(((((r   c                 b    t          j        | j                  }|                     |           d S rB   )r   Canvasr>  r  r   rf  s     r   test_canvas_tag_bindzBindTest.test_canvas_tag_bind  s-    N4:&&Ar   c                 b    t          j        | j                  }|                     |           d S rB   )r   r  r>  r  r  s     r   test_canvas_tag_unbindzBindTest.test_canvas_tag_unbind  s-    N4:&&a     r   c                 b    t          j        | j                  }|                     |           d S rB   )r   r  r>  r  r  s     r   test_canvas_tag_bind_rebindz$BindTest.test_canvas_tag_bind_rebind  s-    N4:&&""1%%%%%r   c                 b    t          j        | j                  }|                     |           d S rB   )r   r  r>  r  r   r#   s     r   test_text_tag_bindzBindTest.test_text_tag_bind  s-    L$$Ar   c                 b    t          j        | j                  }|                     |           d S rB   )r   r  r>  r  r  s     r   test_text_tag_unbindzBindTest.test_text_tag_unbind  s-    L$$a     r   c                 b    t          j        | j                  }|                     |           d S rB   )r   r  r>  r  r  s     r   test_text_tag_bind_rebindz"BindTest.test_text_tag_bind_rebind  s-    L$$""1%%%%%r   c                 Z   | j         }|                     | j                                        d           |                     |                                t	          |          dddf           |                    d           |                     |                                d           d S )N)r'   Tkallr8  r'   r  )r_  zb c)r>  r!   r   bindtagsr*   )r   r$   s     r   test_bindtagszBindTest.test_bindtags  s    J++--/ABBBAU'CDDD	

<   |44444r   c                 ,   d}| j         }t          j        |          }t          j        |ddd          }|                                 |                                 |                                 |                     |j        d|           |                     |j        d|           |                     |j        d|           |                     |j        d|           |                     |j	        |           fd	}|
                    | |d
                     |                    d| |d                     |                    d| |d                     |                    d| |d                     |                    d| |d                     |                    | |d                     |                    | |d                     g |                    |           |                     d|fd|fd|fd
|fg           g |                    |           |                     d|fd|fd
|fg           |                    d           g |                    |           |                     d|fg           d S )Nz<Enter>r8  r9  r  r:  r   r  tag2c                       fdS )Nc                 <                         | j        f          S rB   )r  r   )r   rb  whats    r   <lambda>z9BindTest.test_bind_events.<locals>.test.<locals>.<lambda>  s    V]]D!(+;<< r   rC   )r  rb  s   `r   testz'BindTest.test_bind_events.<locals>.test  s    <<<<<<r   r  zframe classztoplevel classr>  toplevel)r  tag3)r   r   r   r    r?  rh  r`   rx  rw  r  r  rv  rS  rj  r!   r  )r   rT  r   r#   r$   r  rb  s         @r   test_bind_eventszBindTest.test_bind_events  s   yT""M!F#cBBB	)65999):u===)5%888)65999///	= 	= 	= 	= 	= 	eTT%[[)))ttM':':;;;
E440@+A+ABBBudd5kk222ttF||444	udd7mm$$$	udd:&&'''	aLAOAJ	"
 	 	 	 	Oq!AJ"
 	 	 	 	


?###	5!*.....r   )r   r   r   r=  rF  rH  rV  r\  rl  rr  ry  r}  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  __classcell__)r@  s   @r   r6  r6    s           G G G@ @ @) ) )*' ' ' ,F ,F ,F\) ) )0) ) )0$ $ $.) ) )8) ) ).  *) ) )8) ) )6, , ,$) ) )4  ! ! !& & &  ! ! !& & &5 5 5,/ ,/ ,/ ,/ ,/ ,/ ,/r   r6  c                   &    e Zd Zd Zd Zd Zd ZdS )DefaultRootTestc                 j   |                      t          j        d           |                     t          j                   t          j                    }t          j                    }t          j                    }|                      t          j        |           |                                 |                      t          j        |           |                                 |                     t          j                   |                                 |                     t          j                   d S )NT)r  r   _support_default_rootrP   _default_rootr  destroy)r   r   root2root3s       r   test_default_rootz!DefaultRootTest.test_default_root&  s    g3T:::'/000z||

g+T222g+T222'/000'/00000r   c                    |                      t          j        d           |                     t          j                   t          j                    }|                      t          j        |           t          j                     |                      t          j        d           |                     t          t          d                     t          j                     |                      t          j        d           |                     t          t          d                     |	                                 |                      t          j        d           |                     t          t          d                     t          j                    }|                      t          j        d           |                     t          t          d                     |	                                 d S )NTFr  )
r  r   r  rP   r  r  NoDefaultRootr,   hasattrr  r=   s     r   test_no_default_rootz$DefaultRootTest.test_no_default_root4  sm   g3T:::'/000z||g+T222g3U;;;/::;;;g3U;;;/::;;;g3U;;;/::;;;z||g3U;;;/::;;;r   c                    |                      t          t          j        d           t          j                    }|                     t          j        d          d           |                      t          t          j        d           |                                 t          j                     |                      t          t          j        d           d S )Nr  Tr  )	rU   RuntimeErrorr   r  r  r  re   r  r  r=   s     r   r  zDefaultRootTest.test_getbooleanH  s    ,(:C@@@z||g(--t444*g&8%@@@,(:C@@@@@r   c                 h   |                      t          t          j                   t          j                    }|                    |j                   t          j                     |                                 t          j                     |                      t          t          j                   d S rB   )	rU   r  r   r  r  r_   r  r  r  r=   s     r   r"  zDefaultRootTest.test_mainloopQ  s    ,(8999z||	""",(899999r   N)r   r   r   r  r  r  r"  rC   r   r   r  r  $  sS        1 1 1  (A A A: : : : :r   r  c                 j    | j                             | j                             dd|                    S )NrK   commands)rQ   rS   rR   )r   patterns     r   rC  rC  [  s*    9vy~~fj'JJKKKr   __main__rB   )rW   unittestr   r  r  r   tkinter.test.supportr   r   requiresTestCaser   r6  r  rC  r   mainrC   r   r   <module>r     sP                H H H H H H H H     uF uF uF uF uF~x0 uF uF uFp_/ _/ _/ _/ _/~x0 _/ _/ _/D4: 4: 4: 4: 4:-x/@ 4: 4: 4:nL L L L zHMOOOOO r   