HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.10/idlelib/idle_test/__pycache__/test_tooltip.cpython-310.pyc
o

�i	�@s�dZddlmZmZddlmZed�ddlmZddlZddl	m
Z
mZmZddl
Z
dd	�Zd
d�Zdd
�Zdd�ZGdd�de
j�ZGdd�de
j�ZedkrZe
jdd�dSdS)z�Test tooltip, coverage 100%.

Coverage is 100% after excluding 6 lines with "# pragma: no cover".
They involve TclErrors that either should or should not happen in a
particular situation, and which are 'pass'ed if they do.
�)�TooltipBase�Hovertip)�requiresZgui)�wrapsN)�Button�Tk�ToplevelcCs
t�adS�N)r�root�rr�;/usr/local/lib/python3.10/idlelib/idle_test/test_tooltip.py�setUpModules
r
cCst��t��bdSr	)r
Zupdate_idletasks�destroyrrrr�tearDownModulesrcs t����fdd���g�_�S)Ncs�j�||f��|i|��Sr	)�call_args_list�append)�args�kwargs��func�wrapped_funcrrrsz'add_call_counting.<locals>.wrapped_func)rr)rrrr�add_call_countingsrcCsNtt�}|�|j�|�d�t|dd�}|��|�|j�|��||fS)NzTest tooltip�ToolTip test button��text)rr
�
addCleanupr�titler�packZlift)Ztestobj�top�buttonrrr�_make_top_and_button&s
r c@seZdZdd�Zdd�ZdS)�ToolTipBaseTestcC�t|�\|_|_dSr	�r rr��selfrrr�setUp3�zToolTipBaseTest.setUpcCsttt�}|�|j�t|dd�}|��|�|j�|�t��t|�}|�	�Wd�dS1s3wYdS)Nrr)
rr
rrrrZassertRaises�NotImplementedErrorr�showtip)r%rr�tooltiprrr�test_base_class_is_unusable6s
"�z+ToolTipBaseTest.test_base_class_is_unusableN)�__name__�
__module__�__qualname__r&r+rrrrr!2sr!c@sLeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�HovertipTestcCr"r	r#r$rrrr&Er'zHovertipTest.setUpcCs|jo|j��Sr	)�	tipwindowZwinfo_viewable�r%r*rrr�is_tipwindow_shownHszHovertipTest.is_tipwindow_showncCsDt|jd�}|�|j�|�|�|��|��|�|�|��dS�N�ToolTip text)rrr�hidetip�assertFalser2r)�
assertTruer1rrr�test_showtipKs
zHovertipTest.test_showtipcCspt|jd�}|�|j�|�|�|��|��|�|�|��|j}|��|�|�|��|�	|j|�dSr3)
rrrr5r6r2r)r7r0ZassertIs)r%r*Zorig_tipwindowrrr�test_showtip_twiceRszHovertipTest.test_showtip_twicecCs<t|jd�}|�|j�|��|��|�|�|��dSr3)rrrr5r)r6r2r1rrr�test_hidetip]s
zHovertipTest.test_hidetipcCs�t|jddd�}|�|j�t|j�|_t��|�|�	|��|jj
dddd�t��|�|�	|��|�t
|jj�d�dS)Nr4�Zhover_delay�<Enter>r��x�y)rrrr5rr)r
�updater6r2�event_generater7�
assertGreater�lenrr1rrr�$test_showtip_on_mouse_enter_no_delaydsz1HovertipTest.test_showtip_on_mouse_enter_no_delaycCs(t|jddd�}|�|j�t|j�|_t��|�|�	|��|jj
dddd�t��|�|�	|��t|jddd�}|�|j�t|j�|_t��|jj
dddd�t��|jj
dddd�t��t�d�t��|�
|�	|��|�t|jj�d�|�|�	|��|�|jjg�dS)	Nr4�dr;r<rr=�<Leave>g333333�?)rrrr5rr)r
r@r6r2rA�time�sleepr7rBrCrZassertEqual)r%Ztooltip1Ztooltip2rrr�test_hover_with_delayos,
z"HovertipTest.test_hover_with_delaycCs�t|jddd�}|�|j�t|j�|_t��|jjdddd�t��|jjdddd�t��|�	|�
|��|�t|jj
�d�dS)Nr4r;r<rr=rF)rrrr5rr)r
r@rAr6r2rBrCrr1rrr�test_hidetip_on_mouse_leave�sz(HovertipTest.test_hidetip_on_mouse_leaveN)r,r-r.r&r2r8r9r:rDrIrJrrrrr/Ds$r/�__main__�)�	verbosity)�__doc__Zidlelib.tooltiprrZtest.supportr�	functoolsrrG�tkinterrrrZunittestr
rrr ZTestCaser!r/r,�mainrrrr�<module>s"	\�