ó {fc@sâddlZddlmZddlZddlmZddlmZddl m Z ddl m Z dZ dZdejfd „ƒYZd dd „ƒYZd ejfd „ƒYZedkrÞejddddƒndS(iÿÿÿÿN(trequires(tText(tHistory(tidleConfsa = 7sb = at StoreTestcBsJeZdZed„ƒZd„Zd„Zd„Zd„Zd„Z RS(s7Tests History.__init__ and History.store with mock TextcCs"tƒ|_t|jƒ|_dS(N(tmkTextttextRthistory(tcls((s:/usr/lib64/python2.7/idlelib/idle_test/test_idlehistory.pyt setUpClasss cCs#|jjddƒg|j_dS(Ns1.0tend(RtdeleteR(tself((s:/usr/lib64/python2.7/idlelib/idle_test/test_idlehistory.pyttearDownscCs„|j|jj|jƒ|j|jjgƒ|j|jjƒ|j|jjƒ|j|jjtj dddddƒƒdS(NtmainRtcyclicitbool( tassertIsRRt assertEqualt assertIsNonetprefixtpointerRRt GetOption(R ((s:/usr/lib64/python2.7/idlelib/idle_test/test_idlehistory.pyt test_inits cCsP|jjdƒ|j|jjgƒ|jjdƒ|j|jjgƒdS(Ntas a (RtstoreR(R ((s:/usr/lib64/python2.7/idlelib/idle_test/test_idlehistory.pyttest_store_short!scCs…|jjtƒ|j|jjtgƒ|jjtƒ|j|jjttgƒ|jjtƒ|j|jjttgƒdS(N(RRtline1Rtline2(R ((s:/usr/lib64/python2.7/idlelib/idle_test/test_idlehistory.pyttest_store_dup's cCsRt|j_d|j_|jjtƒ|j|jjƒ|j|jjƒdS(Ni(RRRRRRR(R ((s:/usr/lib64/python2.7/idlelib/idle_test/test_idlehistory.pyttest_store_reset/s   ( t__name__t __module__t__doc__t classmethodR R RRRR(((s:/usr/lib64/python2.7/idlelib/idle_test/test_idlehistory.pyR s    t TextWrappercBs#eZd„Zd„Zd„ZRS(cCstd|ƒ|_t|_dS(Ntmaster(ttkTextRtFalset_bell(R R$((s:/usr/lib64/python2.7/idlelib/idle_test/test_idlehistory.pyt__init__8scCst|j|ƒS(N(tgetattrR(R tname((s:/usr/lib64/python2.7/idlelib/idle_test/test_idlehistory.pyt __getattr__;scCs t|_dS(N(tTrueR'(R ((s:/usr/lib64/python2.7/idlelib/idle_test/test_idlehistory.pytbell=s(RR R(R+R-(((s:/usr/lib64/python2.7/idlelib/idle_test/test_idlehistory.pyR#7s  t FetchTestcBs’eZdZed„ƒZd„Zed„ƒZed„Zd„Z d„Z d„Z d„Z d „Z d „Zd „Zd „Zd „ZRS(s-Test History.fetch with wrapped tk.Text. cCs*tdƒtjƒ|_|jjƒdS(Ntgui(RttktTktroottwithdraw(R((s:/usr/lib64/python2.7/idlelib/idle_test/test_idlehistory.pyR Cs cCskt|jƒ|_}|jddƒ|jddƒ|jddƒt|ƒ|_tt g|j_dS(Ns1.0s>>> tiomarks1.4tleft( R#R2Rtinserttmark_sett mark_gravityRRRR(R R((s:/usr/lib64/python2.7/idlelib/idle_test/test_idlehistory.pytsetUpIs cCs|jjƒ|`dS(N(R2tdestroy(R((s:/usr/lib64/python2.7/idlelib/idle_test/test_idlehistory.pyt tearDownClassQs cCs¦|j}|j|ƒ|j}||jjddƒ|ƒ||jj|ƒ|rct|j_n||j|ƒ||j|ƒ||jj dddƒdƒdS(NR4send-1cR6s==i( RtfetchRRtgetR'R&RRtcompare(R treversetlineRtindexR-RtEqual((s:/usr/lib64/python2.7/idlelib/idle_test/test_idlehistory.pyt fetch_testVs   cCsRd}|j}|tt|dƒ|tt|dƒ|t|dddtƒdS(NtiiR-(RCR,RRtNone(R Rttest((s:/usr/lib64/python2.7/idlelib/idle_test/test_idlehistory.pyttest_fetch_prev_cyclicfs  cCsRd}|j}|tt|dƒ|tt|dƒ|t|dddtƒdS(NRDiiR-(RCR&RRRER,(R RRF((s:/usr/lib64/python2.7/idlelib/idle_test/test_idlehistory.pyttest_fetch_next_cyclicms  cCsOd}|jjd|ƒ|jtt|dƒ|jt|dddtƒdS(NRR4iR-(RR6RCR,RRE(R R((s:/usr/lib64/python2.7/idlelib/idle_test/test_idlehistory.pyttest_fetch_prev_prefixuscCsOd}|jjd|ƒ|jtt|dƒ|jt|dddtƒdS(NRR4iR-(RR6RCR&RRER,(R R((s:/usr/lib64/python2.7/idlelib/idle_test/test_idlehistory.pyttest_fetch_next_prefix{scCs^d}t|j_|j}|tt|dƒ|tt|dƒ|tt|ddtƒdS(NRDiiR-(R&RRRCR,RR(R RRF((s:/usr/lib64/python2.7/idlelib/idle_test/test_idlehistory.pyttest_fetch_prev_noncyclics   cCs}d}t|j_|j}|t|dddtƒ|tt|dƒ|t|dddtƒ|t|dddtƒdS(NRDR-i(R&RRRCRER,R(R RRF((s:/usr/lib64/python2.7/idlelib/idle_test/test_idlehistory.pyttest_fetch_next_noncyclic‰s  cCsF|jjdtƒ|jjddƒ|jttdddtƒdS(NR?R6R4R-(RR<R,RR7RCRRE(R ((s:/usr/lib64/python2.7/idlelib/idle_test/test_idlehistory.pyttest_fetch_cursor_move’scCsS|jjdtƒ|jjddƒ|jjddƒ|jttddƒdS(NR?R4R6sa =i(RR<R,RR R6RCR(R ((s:/usr/lib64/python2.7/idlelib/idle_test/test_idlehistory.pyttest_fetch_edit˜scCsP|jjdƒ|j|jjdƒ|jjdƒ|j|jjdƒdS(Ns dummy eventi(Rt history_prevRRt history_nextRE(R ((s:/usr/lib64/python2.7/idlelib/idle_test/test_idlehistory.pyttest_history_prev_nextŸs(RR R!R"R R9R;R&RCRGRHRIRJRKRLRMRNRQ(((s:/usr/lib64/python2.7/idlelib/idle_test/test_idlehistory.pyR.@s         t__main__t verbosityitexit((tunittestttest.test_supportRtTkinterR0RR%tidlelib.idle_test.mock_tkRtidlelib.IdleHistoryRtidlelib.configHandlerRRRtTestCaseRR#R.RR(((s:/usr/lib64/python2.7/idlelib/idle_test/test_idlehistory.pyts  * g