ó ükWc@sdZddlZddlmZmZddlmZddlmZddl Z edƒdZ ddd „ƒYZ e ƒZ d dd „ƒYZ e ƒZd ejfd „ƒYZdejfd„ƒYZdejfd„ƒYZedkr ejdddeƒndS(s !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. i˙˙˙˙N(tcaptured_stdouttfindfile(tVar(t GrepDialogsidlelib/idle_tests /test_grep.pytDummy_searchenginecBseZdZd„ZRS(sŇGrepDialog.__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(t_pat(tself((s1/usr/lib/python2.7/idlelib/idle_test/test_grep.pytgetpats(t__name__t __module__t__doc__R(((s1/usr/lib/python2.7/idlelib/idle_test/test_grep.pyRst Dummy_grepcBs;eZejjZejjZeeƒZe Z d„Z RS(cCsdS(N((R((s1/usr/lib/python2.7/idlelib/idle_test/test_grep.pytclose"s( RR Rtgrep_ittim_funct findfilesRtFalsetrecvart searchenginetengineR (((s1/usr/lib/python2.7/idlelib/idle_test/test_grep.pyR s    t FindfilesTestcBseZRS((RR (((s1/usr/lib/python2.7/idlelib/idle_test/test_grep.pyR'st Grep_itTestcBs#eZd„Zd„Zd„ZRS(cCsZ|tj_tƒ }tjtj|ƒtƒWdQX|jƒj dƒ}|j ƒ|S(Ns ( tgrepRRRR tretcompilet__file__tgetvaluetsplittpop(Rtpattstlines((s1/usr/lib/python2.7/idlelib/idle_test/test_grep.pytreport3s    cCs[dd}|j|ƒ}|jt|ƒdƒ|j||dƒ|j|ddƒdS(Nsxyz*iiiisNo hits.(R t assertEqualtlentassertIn(RRR((s1/usr/lib/python2.7/idlelib/idle_test/test_grep.pyt test_unfound;s  cCs…d}|j|ƒ}|jt|ƒdƒ|j||dƒ|jd|dƒ|jd|dƒ|j|djd ƒƒdS( Ns<""" !Changing this line will break Test_findfile.test_found!iispy: 1:it2iis(Hint:(R R!R"R#t assertTruet startswith(RRR((s1/usr/lib/python2.7/idlelib/idle_test/test_grep.pyt test_foundBs(RR R R$R((((s1/usr/lib/python2.7/idlelib/idle_test/test_grep.pyR.s  tDefault_commandTestcBseZRS((RR (((s1/usr/lib/python2.7/idlelib/idle_test/test_grep.pyR)Lst__main__t verbosityitexit(((R tunittestttest.test_supportRRtidlelib.idle_test.mock_tkRtidlelib.GrepDialogRRRRRR RtTestCaseRRR)RtmainR(((s1/usr/lib/python2.7/idlelib/idle_test/test_grep.pyts