ó {fc@s¶dZddlZddlmZddlmZmZmZmZddl m Z ddl m Z ddlmZdejfd „ƒYZed kr²ejd d d d ƒ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(tTexttTktTopleveltFrame(t SearchEngine(tSearchDialogBase(tFunctSearchDialogBaseTestcBs’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/lib64/python2.7/idlelib/idle_test/test_searchdialogbase.pyt setUpClasss cCs|jjƒ|`dS(N(R tdestroy(R ((s?/usr/lib64/python2.7/idlelib/idle_test/test_searchdialogbase.pyt tearDownClass s cCs:tj|jƒ|_tjd|jd|jƒ|_dS(NR tengine(tseRR RtsdbRtdialog(tself((s?/usr/lib64/python2.7/idlelib/idle_test/test_searchdialogbase.pytsetUp%scCs|jjƒdS(N(Rtclose(R((s?/usr/lib64/python2.7/idlelib/idle_test/test_searchdialogbase.pyttearDown)scCsÆd|j_t|jƒ}t|ƒ}|jj|ƒ|j|jjj ƒdƒ|jj ƒ|j|jjj ƒdƒ|jj|ddƒ|j|jj j ƒdƒ|j ƒ|jƒdS(Ntnormalt withdrawnt searchphrasethello(tNoneRtdefault_commandRR Rtopent assertEqualttoptstateRtenttgettupdate_idletasksR (Rttoplevelttext((s?/usr/lib64/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( RRtcreate_entriestcreate_option_buttonstcreate_other_buttonstcreate_command_buttonsRRtcreate_widgetst assertTruetcalled(R((s?/usr/lib64/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:RR%trowtcolumnitrowspant columnspan( RRR/RR Rt make_entrytassertInR"t grid_infotint(Rtequaltentrytlabeltegi((s?/usr/lib64/python2.7/idlelib/idle_test/test_searchdialogbase.pyttest_make_entryJs   cCsId|j_|jjdƒ|jjƒ|j|jjjƒdƒdS(NiR(RR/RtsetpatR'R4R!R"(R((s?/usr/lib64/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%( RR/RR Rt make_frameRtassertIsInstanceR(RtframeR9((s?/usr/lib64/python2.7/idlelib/idle_test/test_searchdialogbase.pyttest_make_frame_s cCs(t|jƒ|j_d|j_|ƒS(Ni(RR RRR/(Rtmeth((s?/usr/lib64/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(RtrevartcasevartwordvartwrapvartsetRERR(tzipt pack_slavesRR"tdeselecttselect( RteR tvarRBtoptionstspectbuttonR9((s?/usr/lib64/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(NR%i( tFalsetTrueRtbackvarRJRERR)RLRKRR"RN( RR RPRBtotherstbuttonsRRRStvalR9((s?/usr/lib64/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%( RR RRRt buttonframet make_buttonRR(Rtbtn((s?/usr/lib64/python2.7/idlelib/idle_test/test_searchdialogbase.pyttest_make_button“scCsa|jjƒd}x7|jjjƒD]#}|ddkr&|d}q&q&W|jd|ƒdS(NR>R%Rtcommand(RR*R]twinfo_childrenR4(Rtclosebuttoncommandtchild((s?/usr/lib64/python2.7/idlelib/idle_test/test_searchdialogbase.pyttest_create_command_buttons™s  (t__name__t __module__t classmethodR RRRR&R.R;R=RCRERTR[R`Re(((s?/usr/lib64/python2.7/idlelib/idle_test/test_searchdialogbase.pyRs          t__main__t verbosityitexit(t__doc__tunittestttest.test_supportRtTkinterRRRRtidlelibRRRRtidlelib.idle_test.mock_idleRtTestCaseRRftmain(((s?/usr/lib64/python2.7/idlelib/idle_test/test_searchdialogbase.pyts " ‹