7ec@sddlZddlmZddlZddlmZddlmZddl m Z ddl m Z dZ dZdejfd YZd dd YZd ejfd YZedkrejddddndS(iN(trequires(tText(tHistory(tidleConfsa = 7sb = at StoreTestcBsJeZdZedZdZdZdZdZdZ 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#|jjddg|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 ddddddS(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|jjgdS(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|jjttgdS(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|jjdS(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#eZdZdZdZRS(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 FetchTestcBseZdZedZdZedZedZdZ dZ dZ dZ d Z d Zd Zd Zd ZRS(s-Test History.fetch with wrapped tk.Text. cCs*tdtj|_|jjdS(Ntgui(RttktTktroottwithdraw(R((s:/usr/lib64/python2.7/idlelib/idle_test/test_idlehistory.pyR Cs cCskt|j|_}|jdd|jdd|jddt||_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 dddddS(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|dddtdS(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|dddtdS(NRDiiR-(RCR&RRRER,(R RRF((s:/usr/lib64/python2.7/idlelib/idle_test/test_idlehistory.pyttest_fetch_next_cyclicms  cCsOd}|jjd||jtt|d|jt|dddtdS(NRR4iR-(RR6RCR,RRE(R R((s:/usr/lib64/python2.7/idlelib/idle_test/test_idlehistory.pyttest_fetch_prev_prefixuscCsOd}|jjd||jtt|d|jt|dddtdS(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|ddtdS(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|dddtdS(NRDR-i(R&RRRCRER,R(R RRF((s:/usr/lib64/python2.7/idlelib/idle_test/test_idlehistory.pyttest_fetch_next_noncyclics  cCsF|jjdt|jjdd|jttdddtdS(NR?R6R4R-(RR<R,RR7RCRRE(R ((s:/usr/lib64/python2.7/idlelib/idle_test/test_idlehistory.pyttest_fetch_cursor_movescCsS|jjdt|jjdd|jjdd|jttdddS(NR?R4R6sa =i(RR<R,RR R6RCR(R ((s:/usr/lib64/python2.7/idlelib/idle_test/test_idlehistory.pyttest_fetch_editscCsP|jjd|j|jjd|jjd|j|jjddS(Ns dummy eventi(Rt history_prevRRt history_nextRE(R ((s:/usr/lib64/python2.7/idlelib/idle_test/test_idlehistory.pyttest_history_prev_nexts(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