Your IP : 13.58.214.43


Current Path : /opt/alt/python36/lib64/python3.6/idlelib/idle_test/__pycache__/
Upload File :
Current File : //opt/alt/python36/lib64/python3.6/idlelib/idle_test/__pycache__/test_tooltip.cpython-36.pyc

3

� f
�@s�ddlmZmZddlmZed�ddlmZddlZddlm	Z	m
Z
mZddlZdd�Z
d	d
�Zdd�Zd
d�Zdd�ZGdd�dej�ZGdd�dej�Zedkr�ejdd�dS)�)�TooltipBase�Hovertip)�requiresZgui)�wrapsN)�Button�Tk�ToplevelcCs
t�adS)N)r�root�r
r
�C/opt/alt/python36/lib64/python3.6/idlelib/idle_test/test_tooltip.py�setUpModulesrcCstj�dS)N)r	�updater
r
r
r�root_updatesrcCstj�tj�bdS)N)r	Zupdate_idletasks�destroyr
r
r
r�tearDownModulesrcs t����fdd���g�_�S)Ncs�jj||f��||�S)N)�call_args_list�append)�args�kwargs)�func�wrapped_funcr
rrsz'add_call_counting.<locals>.wrapped_func)rr)rr
)rrr�add_call_countingsrcCsNtt�}|j|j�|jd�t|dd�}|j�|j|j�|j�||fS)NzTest tooltipzToolTip test button)�text)rr	�
addCleanupr�titler�packZlift)Ztestobj�top�buttonr
r
r�_make_top_and_button"s
rc@seZdZdd�Zdd�ZdS)�ToolTipBaseTestcCst|�\|_|_dS)N)rrr)�selfr
r
r�setUp/szToolTipBaseTest.setUpc	Cs^tt�}|j|j�t|dd�}|j�|j|j�|jt��t|�}|j	�WdQRXdS)NzToolTip test button)r)
rr	rrrrZassertRaises�NotImplementedErrorr�showtip)r rr�tooltipr
r
r�test_base_class_is_unusable2sz+ToolTipBaseTest.test_base_class_is_unusableN)�__name__�
__module__�__qualname__r!r%r
r
r
rr.src@sLeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�HovertipTestcCst|�\|_|_dS)N)rrr)r r
r
rr!AszHovertipTest.setUpcCsPt|jd�}|j|j�|j|jo*|jj��|j�|j|joH|jj��dS)NzToolTip text)	rrr�hidetip�assertFalse�	tipwindow�winfo_viewabler#�
assertTrue)r r$r
r
r�test_showtipDs
zHovertipTest.test_showtipcCs�t|jd�}|j|j�|j|jo*|jj��|j�|j|joH|jj��|j}|j�|j|jol|jj��|j	|j|�dS)NzToolTip text)
rrrr*r+r,r-r#r.ZassertIs)r r$Zorig_tipwindowr
r
r�test_showtip_twiceKszHovertipTest.test_showtip_twicecCsBt|jd�}|j|j�|j�|j�|j|jo:|jj��dS)NzToolTip text)rrrr*r#r+r,r-)r r$r
r
r�test_hidetipVs
zHovertipTest.test_hidetipcCs�t|jddd�}|j|j�t|j�|_t�|j|jo@|jj	��|jj
dddd�t�|j|jon|jj	��|jt
|jj�d�dS)NzToolTip text)�hover_delayz<Enter>r)�x�y)rrrr*rr#rr+r,r-�event_generater.�
assertGreater�lenr)r r$r
r
r�$test_showtip_on_mouse_enter_no_delay]sz1HovertipTest.test_showtip_on_mouse_enter_no_delaycCs�t|jddd�}|j|j�t|j�|_t�|j|jo@|jj	��|jj
dddd�t�|j|jon|jj	��tjd�t�|j
|jo�|jj	��|jt|jj�d�dS)NzToolTip text�2)r2z<Enter>r)r3r4g�������?)rrrr*rr#rr+r,r-r5�time�sleepr.r6r7r)r r$r
r
r�'test_showtip_on_mouse_enter_hover_delayhs
z4HovertipTest.test_showtip_on_mouse_enter_hover_delaycCs�t|jddd�}|j|j�t|j�|_t�|jjdddd�t�|jjdddd�t�|j|j	op|j	j
��|jt|jj
�d�dS)NzToolTip text)r2z<Enter>r)r3r4z<Leave>)rrrr*rr#rr5r+r,r-r6r7r)r r$r
r
r�test_hidetip_on_mouse_leavevsz(HovertipTest.test_hidetip_on_mouse_leavecCs�t|jddd�}|j|j�t|j�|_t�|jjdddd�t�|jjdddd�t�tj	d�t�|j
|jo�|jj��|j
|jjg�dS)	NzToolTip textr9)r2z<Enter>r)r3r4z<Leave>g�������?)rrrr*rr#rr5r:r;r+r,r-ZassertEqualr)r r$r
r
r�*test_dont_show_on_mouse_leave_before_delay�s
z7HovertipTest.test_dont_show_on_mouse_leave_before_delayN)r&r'r(r!r/r0r1r8r<r=r>r
r
r
rr)@sr)�__main__�)�	verbosity)Zidlelib.tooltiprrZtest.supportr�	functoolsrr:ZtkinterrrrZunittestrrrrrZTestCaserr)r&�mainr
r
r
r�<module>s	Q

?>