Your IP : 13.58.72.156


Current Path : /opt/alt/python37/lib64/python3.7/idlelib/idle_test/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/idlelib/idle_test/__pycache__/test_autoexpand.cpython-37.pyc

B

� f�@sldZddlmZddlZddlmZddlmZmZGdd�d�Z	Gdd	�d	ej
�Zed
krhej
dd�dS)
zTest autoexpand, coverage 100%.�)�
AutoExpandN)�requires)�Text�Tkc@seZdZdd�ZdS)�DummyEditwincCs
||_dS)N)�text)�selfr�r	�F/opt/alt/python37/lib64/python3.7/idlelib/idle_test/test_autoexpand.py�__init__szDummyEditwin.__init__N)�__name__�
__module__�__qualname__rr	r	r	r
r	src@sTeZdZedd��Zedd��Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�ZdS)�AutoExpandTestcCs<td�t�|_t|j�|_tt|j��|_dd�|j_dS)NZguicSsdS)Nr	r	r	r	r
�<lambda>�z+AutoExpandTest.setUpClass.<locals>.<lambda>)	rr�tkrrrr�auto_expandZbell)�clsr	r	r
�
setUpClasss
zAutoExpandTest.setUpClasscCs$|`|`t|d�r |j��|`dS)Nr)rr�hasattrrZdestroy)rr	r	r
�
tearDownClass's

zAutoExpandTest.tearDownClasscCs|j�dd�dS)Nz1.0�end)r�delete)rr	r	r
�tearDown.szAutoExpandTest.tearDowncCs�|j}|jj}|j}||�d�|�dd�||�d�|�dd�||�d�|�dd�||�d�|�dd�||�d�|�dd�||�d	�|�d
d�||�d�|�dd�||�d�dS)
N��insert�tZhis�this� �isz
sample
string�stringz3.0z1.0r)rr�getprevword�assertEqualrr)rr�previous�equalr	r	r
�test_get_prevword1s$z AutoExpandTest.test_get_prevwordcCs�|jj}|jj}|j}|j�dd�||j��ddddg�|d�||�d�|d�||�d�|d�||�d�|d�||�d�dS)Nrzab ac bx ad ab a�ab�ad�ac�a�event)rr"�expand_word_eventr#rr�getwords)rr$�expandr%r	r	r
�test_before_onlyMszAutoExpandTest.test_before_onlycCs�|j}|jj}|jj}|j}|�dd�|�dd�||j��ddddg�|d�||�d�|d�||�d�|d�||�d�|d�||�d�dS)	Nrz a, [ab] ac: () bx"" cd ac= ad yaz1.1r'r)r(r*r+)rrr"r,r#r�mark_setr-)rrr$r.r%r	r	r
�test_after_only]szAutoExpandTest.test_after_onlycCs�|j}|jj}|jj}|j}|�dd�|�dd�|�dd�||j��dddg�|d�||�d�|d�||�d�|d�||�d�dS)	Nrz	ab xy yz
z
a ac by acz2.1r'r)r*r+)rrr"r,r#rr0r-)rrr$r.r%r	r	r
�test_both_before_afterpsz%AutoExpandTest.test_both_before_aftercCs�|j}|jj}|j}||j��g�||d�d�|�dd�||j��g�|�dd�|�dd�|d�|jj}|�dd�|d�|jj}|�||�dS)Nr+�breakrz
bx cy dz azac xy a ac ad az1.7z1.end)	rrr,r#r-rr0�stateZassertNotEqual)rrr.r%Z
initial_stateZ	new_stater	r	r
�test_other_expand_cases�sz&AutoExpandTest.test_other_expand_casesN)rr
r�classmethodrrrr&r/r1r2r5r	r	r	r
rsr�__main__�)�	verbosity)�__doc__Zidlelib.autoexpandrZunittestZtest.supportrZtkinterrrrZTestCaserr�mainr	r	r	r
�<module>s


?>