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



Yfo
@sdZddlZddlmZddlmZddlmZddlZGdddZ	e	Z
Gdd	d	ZeZGd
ddej
ZGdd
d
ej
ZGdddej
ZedkrejdddddS)a !Changing this line will break Test_findfile.test_found!
Non-gui unit tests for idlelib.GrepDialog methods.
dummy_command calls grep_it calls findfiles.
An exception raised in one method will fail callers.
Otherwise, tests are mostly independent.
*** Currently only test grep_it.
N)captured_stdout)Var)
GrepDialogc@s"eZdZdZddZdS)Dummy_searchenginezGrepDialog.__init__ calls parent SearchDiabolBase which attaches the
    passed in SearchEngine instance as attribute 'engine'. Only a few of the
    many possible self.engine.x attributes are needed here.
    cCs|jS)N)_pat)selfr@/opt/alt/python35/lib64/python3.5/idlelib/idle_test/test_grep.pygetpatszDummy_searchengine.getpatN)__name__
__module____qualname____doc__r
rrrr	rsrc@s@eZdZejZejZedZeZ	ddZ
dS)
Dummy_grepFcCsdS)Nr)rrrr	close szDummy_grep.closeN)rrr
rgrep_itZ	findfilesrZrecvarsearchengineenginerrrrr	rs
		rc@seZdZdS)
FindfilesTestN)rrr
rrrr	r%src@s4eZdZddZddZddZdS)Grep_itTestc
Cs[|tj_t }tjtj|tWdQRX|jj	d}|j
|S)N
)greprrrrrecompile__file__getvaluesplitpop)rpatslinesrrr	report1s 
zGrep_itTest.reportcCs[dd}|j|}|jt|d|j||d|j|dddS)Nzxyz*rzNo hits.)r!assertEquallenassertIn)rrr rrr	test_unfound9s

zGrep_itTest.test_unfoundcCsd}|j|}|jt|d|j||d|jd|d|jd|d|j|djd	dS)
Nz<""" !Changing this line will break Test_findfile.test_found!rzpy: 1:r$2z(Hint:)r!r%r&r'Z
assertTrue
startswith)rrr rrr	
test_found@szGrep_itTest.test_foundN)rrr
r!r(r.rrrr	r,src@seZdZdS)Default_commandTestN)rrr
rrrr	r/Jsr/__main__	verbosityr#exitF)rZunittestZtest.supportrZidlelib.idle_test.mock_tkrZidlelib.GrepDialogrrrrrrZTestCaserrr/rmainrrrr	<module>s		
Back to Directory File Manager