ó ÕЮ]c@s°dZddlZddlmZddlmZmZmZddlm Z ddlm Z ddl mZdejfd „ƒ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(tTktTopleveltFrame(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((sL/opt/alt/python27/lib64/python2.7/idlelib/idle_test/test_searchdialogbase.pyt setUpClasss cCs|jjƒ|`dS(N(R tdestroy(R ((sL/opt/alt/python27/lib64/python2.7/idlelib/idle_test/test_searchdialogbase.pyt tearDownClass s cCs:tj|jƒ|_tjd|jd|jƒ|_dS(NR tengine(tseRR RtsdbRtdialog(tself((sL/opt/alt/python27/lib64/python2.7/idlelib/idle_test/test_searchdialogbase.pytsetUp%scCs|jjƒdS(N(Rtclose(R((sL/opt/alt/python27/lib64/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((sL/opt/alt/python27/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((sL/opt/alt/python27/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:RRtrowtcolumnitrowspant columnspan( RRR,RR Rt make_entrytassertInR"t grid_infotint(Rtequaltentrytlabeltegi((sL/opt/alt/python27/lib64/python2.7/idlelib/idle_test/test_searchdialogbase.pyttest_make_entryIs   cCsId|j_|jjdƒ|jjƒ|j|jjjƒdƒdS(NiR(RR,RtsetpatR$R1R!R"(R((sL/opt/alt/python27/lib64/python2.7/idlelib/idle_test/test_searchdialogbase.pyttest_create_entriesXs  cCs–d|j_t|jƒ|j_|jjƒ\}}|j|dƒ|j|tƒ|jjdƒ\}}|j|ddƒ|j|tƒdS(Nitt testlabelR( RR,RR Rt make_frameRtassertIsInstanceR(RtframeR6((sL/opt/alt/python27/lib64/python2.7/idlelib/idle_test/test_searchdialogbase.pyttest_make_frame^s cCs(t|jƒ|j_d|j_|ƒS(Ni(RR RRR,(Rtmeth((sL/opt/alt/python27/lib64/python2.7/idlelib/idle_test/test_searchdialogbase.pytbtn_test_setupis 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(RtrevartcasevartwordvartwrapvartsetRBRR%tzipt pack_slavesRR"tdeselecttselect( RteR tvarR?toptionstspectbuttonR6((sL/opt/alt/python27/lib64/python2.7/idlelib/idle_test/test_searchdialogbase.pyttest_create_option_buttonsns  %"    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( tFalsetTrueRtbackvarRGRBRR&RIRHRR"RK( RR RMR?totherstbuttonsRORPtvalR6((sL/opt/alt/python27/lib64/python2.7/idlelib/idle_test/test_searchdialogbase.pyttest_create_other_buttonss     cCs`t|jƒ|j_t|jjƒ|j_|jjd|jjƒ}|j|ddƒdS(NtTestR( RR RRRt buttonframet make_buttonRR(Rtbtn((sL/opt/alt/python27/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;RRtcommand(RR'RZtwinfo_childrenR1(Rtclosebuttoncommandtchild((sL/opt/alt/python27/lib64/python2.7/idlelib/idle_test/test_searchdialogbase.pyttest_create_command_buttons˜s  (t__name__t __module__t classmethodR R RRR#R+R8R:R@RBRQRXR]Rb(((sL/opt/alt/python27/lib64/python2.7/idlelib/idle_test/test_searchdialogbase.pyRs          t__main__t verbosityitexit(t__doc__tunittestttest.test_supportRtTkinterRRRtidlelibRRRRtidlelib.idle_test.mock_idleRtTestCaseRRctmain(((sL/opt/alt/python27/lib64/python2.7/idlelib/idle_test/test_searchdialogbase.pyts  Š