ó ükWc@sØdZddlZddlmZddlmZmZmZmZm Z m Z ddl m Z ddl mZddlmZddlmZmZd ejfd „ƒYZed krÔejd d dd ƒndS(s©Unittests for idlelib/SearchDialogBase.py Coverage: 99%. The only thing not covered is inconsequential -- testing skipping of suite when self.needwrapbutton is false. iÿÿÿÿN(trequires(tTktTopleveltFrametLabelt BooleanVart StringVar(t SearchEngine(tSearchDialogBase(tFunc(tVartMboxtSearchDialogBaseTestcBs’eZed„ƒZed„ƒZd„Zd„Zd„Zd„Zd„Z d„Z d„Z d „Z d „Z d „Zd „Zd „ZRS(cCstdƒtƒ|_dS(Ntgui(RRtroot(tcls((s=/usr/lib/python2.7/idlelib/idle_test/test_searchdialogbase.pyt setUpClasss cCs|jjƒ|`dS(N(Rtdestroy(R((s=/usr/lib/python2.7/idlelib/idle_test/test_searchdialogbase.pyt tearDownClass!s cCs:tj|jƒ|_tjd|jd|jƒ|_dS(NRtengine(tseRRRtsdbRtdialog(tself((s=/usr/lib/python2.7/idlelib/idle_test/test_searchdialogbase.pytsetUp&scCs|jjƒdS(N(Rtclose(R((s=/usr/lib/python2.7/idlelib/idle_test/test_searchdialogbase.pyttearDown*scCs¤d|j_|jjdƒ|j|jjjƒdƒ|jjƒ|j|jjjƒdƒ|jjdddƒ|j|jjj ƒdƒ|jjƒdS(Nttexttnormalt withdrawnt searchphrasethello( tNoneRtdefault_commandtopent assertEqualttoptstateRtenttget(R((s=/usr/lib/python2.7/idlelib/idle_test/test_searchdialogbase.pyttest_open_and_close-s  cCs±tƒ|j_tƒ|j_tƒ|j_tƒ|j_d|j_|jjƒ|j |jjj ƒ|j |jjj ƒ|j |jjj ƒ|j |jjj ƒdS(N( R Rtcreate_entriestcreate_option_buttonstcreate_other_buttonstcreate_command_buttonsR R!tcreate_widgetst assertTruetcalled(R((s=/usr/lib/python2.7/idlelib/idle_test/test_searchdialogbase.pyttest_create_widgets<s  cCsë|j}d|j_t|jƒ|j_|jjddƒ\}}||ddƒ|j|jƒdƒ|j ƒ}|t |dƒdƒ|t |dƒdƒ|t |dƒdƒ|t |d ƒdƒ||jjdƒdS( NisTest:RRtrowtcolumnitrowspant columnspan( R#RR1RRR$t make_entrytassertInR't grid_infotint(Rtequaltentrytlabeltegi((s=/usr/lib/python2.7/idlelib/idle_test/test_searchdialogbase.pyttest_make_entryJs   cCsId|j_|jjdƒ|jjƒ|j|jjjƒdƒdS(NiR(RR1RtsetpatR)R6R&R'(R((s=/usr/lib/python2.7/idlelib/idle_test/test_searchdialogbase.pyttest_create_entriesYs  cCs–d|j_t|jƒ|j_|jjƒ\}}|j|dƒ|j|tƒ|jjdƒ\}}|j|ddƒ|j|tƒdS(Nitt testlabelR( RR1RRR$t make_frameR#tassertIsInstanceR(RtframeR;((s=/usr/lib/python2.7/idlelib/idle_test/test_searchdialogbase.pyttest_make_frame_s cCs(t|jƒ|j_d|j_|ƒS(Ni(RRRR$R1(Rtmeth((s=/usr/lib/python2.7/idlelib/idle_test/test_searchdialogbase.pytbtn_test_setupjs c Cs|j}xødD]ð}x3|j|j|j|jfD]}|j|ƒq5W|j|jjƒ\}}x–t ||j ƒƒD]\}}|\}}|j |d|ƒ|j |j ƒ|ƒ|dkrØ|j ƒn |jƒ|j |j ƒd|ƒq}WqWdS(NiiR(ii(RtrevartcasevartwordvartwrapvartsetRGRR*tzipt pack_slavesR#R'tdeselecttselect( RteR%tvarRDtoptionstspectbuttonR;((s=/usr/lib/python2.7/idlelib/idle_test/test_searchdialogbase.pyttest_create_option_buttonsos  %"    c Csx ttfD]û}|jj}|j|ƒ|j|jjƒ\}}|jƒ}x²t ||ƒD]¡\}}|\}} |j |d| ƒ||krc|j |j ƒ|ƒ||j ƒ|j |j ƒd|ƒ|d|j ƒ|j |j ƒ|ƒqcqcWq WdS(NRi( tFalsetTrueRtbackvarRLRGRR+RNRMR#R'RP( RR%RRRDtotherstbuttonsRTRUtvalR;((s=/usr/lib/python2.7/idlelib/idle_test/test_searchdialogbase.pyttest_create_other_buttons€s     cCs`t|jƒ|j_t|jjƒ|j_|jjd|jjƒ}|j|ddƒdS(NtTestR( RRRR$Rt buttonframet make_buttonRR#(Rtbtn((s=/usr/lib/python2.7/idlelib/idle_test/test_searchdialogbase.pyttest_make_button“scCsa|jjƒd}x7|jjjƒD]#}|ddkr&|d}q&q&W|jd|ƒdS(NR@RRtcommand(RR,R_twinfo_childrenR6(Rtclosebuttoncommandtchild((s=/usr/lib/python2.7/idlelib/idle_test/test_searchdialogbase.pyttest_create_command_buttons™s  (t__name__t __module__t classmethodRRRRR(R0R=R?RERGRVR]RbRg(((s=/usr/lib/python2.7/idlelib/idle_test/test_searchdialogbase.pyR s          t__main__t verbosityitexit(t__doc__tunittestttest.test_supportRtTkinterRRRRRRtidlelibRRRRtidlelib.idle_test.mock_idleR tidlelib.idle_test.mock_tkR R tTestCaseR Rhtmain(((s=/usr/lib/python2.7/idlelib/idle_test/test_searchdialogbase.pyts . Š