Viewing File: /opt/alt/python35/lib64/python3.5/idlelib/idle_test/__pycache__/test_autoexpand.cpython-35.pyc



Yf@sdZddlZddlmZddlmZmZddlmZGdddZ	Gdd	d	ej
Zed
krej
dddS)
z!Unit tests for idlelib.AutoExpandN)requires)TextTk)
AutoExpandc@seZdZddZdS)
Dummy_EditwincCs
||_dS)N)text)selfrr	F/opt/alt/python35/lib64/python3.5/idlelib/idle_test/test_autoexpand.py__init__szDummy_Editwin.__init__N)__name__
__module____qualname__rr	r	r	r
r	src@s|eZdZeddZeddZddZddZd	d
ZddZ	d
dZ
ddZdS)AutoExpandTestcCsedttkr=tdt|_t|j|_nt|_tt|j|_dS)NtkinterZgui)	strrrrtkrrrauto_expand)clsr	r	r

setUpClasss
zAutoExpandTest.setUpClasscCs2|`|`t|dr.|jj|`dS)Nr)rrhasattrrZdestroy)rr	r	r

tearDownClasss
zAutoExpandTest.tearDownClasscCs|jjdddS)Nz1.0end)rdelete)rr	r	r
tearDown!szAutoExpandTest.tearDowncCs|j}|jj}|j}||d|jdd||d|jdd||d|jdd||d|jdd||d|jdd||d	|jd
d||d|jdd||ddS)
NinserttZhisthis isz
sample
stringstringz3.0z1.0r)rrgetprevwordassertEqualrr)rrpreviousequalr	r	r
test_get_prevword$s$		z AutoExpandTest.test_get_prevwordcCs|jj}|jj}|j}|jjdd||jjddddg|d||d|d||d|d||d|d||ddS)Nrzab ac bx ad ab aabadacaevent)rr"expand_word_eventr#rrgetwords)rr$expandr%r	r	r
test_before_only@s	"



zAutoExpandTest.test_before_onlycCs|j}|jj}|jj}|j}|jdd|jdd||jjddddg|d||d|d||d|d||d|d||ddS)	Nrz a, [ab] ac: () bx"" cd ac= ad yaz1.1r'r)r(r*r+)rrr"r,r#rmark_setr-)rrr$r.r%r	r	r
test_after_onlyPs		"



zAutoExpandTest.test_after_onlycCs|j}|jj}|jj}|j}|jdd|jdd|jdd||jjdddg|d||d|d||d|d||ddS)	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_aftercs		


z%AutoExpandTest.test_both_before_aftercCs|j}|jj}|j}||jjg||dd|jdd||jjg|jdd|jdd|d|jj}|jdd|d|jj}|j||dS)Nr+breakrz
bx cy dz azac xy a ac ad az1.7z1.end)	rrr,r#r-rr0stateZassertNotEqual)rrr.r%Z
initial_stateZ	new_stater	r	r
test_other_expand_casesus		

z&AutoExpandTest.test_other_expand_casesN)rr
rclassmethodrrrr&r/r1r2r5r	r	r	r
rs
r__main__	verbosity)__doc__ZunittestZtest.supportrrrrZidlelib.AutoExpandrrZTestCaserrmainr	r	r	r
<module>s~
Back to Directory File Manager