3 2a@sddlmZddlZddlmZddlZddlmZddl mZ ddl m Z dZ dZGdd d ejZGd d d ZGd d d ejZedkrejddddS))HistoryN)requires)Text)idleConfza = 7zb = ac@s@eZdZeddZddZddZddZd d Zd d Z d S) StoreTestcCst|_t|j|_dS)N)mkTexttextrhistory)clsr 1/opt/alt/python36/lib64/python3.6/test_history.py setUpClassszStoreTest.setUpClasscCs|jjddg|j_dS)Nz1.0end)rdeleter )selfr r r tearDownszStoreTest.tearDowncCs`|j|jj|j|j|jjg|j|jj|j|jj|j|jjtj ddddddS)Nmainrcyclicbool) ZassertIsr r assertEqual assertIsNoneprefixpointerrrZ GetOption)rr r r test_inits  zStoreTest.test_initcCs<|jjd|j|jjg|jjd|j|jjgdS)Naz a )r storer)rr r r test_store_short$s  zStoreTest.test_store_shortcCsb|jjt|j|jjtg|jjt|j|jjttg|jjt|j|jjttgdS)N)r rline1rline2)rr r r test_store_dup*s    zStoreTest.test_store_dupcCs<t|j_d|j_|jjt|j|jj|j|jjdS)Nr)rr rrrrr)rr r r test_store_reset2s  zStoreTest.test_store_resetN) __name__ __module__ __qualname__ classmethodr rrrr r!r r r r rs  rc@s$eZdZddZddZddZdS) TextWrappercCst|d|_d|_dS)N)masterF)tkTextr_bell)rr'r r r __init__;s zTextWrapper.__init__cCs t|j|S)N)getattrr)rnamer r r __getattr__>szTextWrapper.__getattr__cCs d|_dS)NT)r))rr r r bell@szTextWrapper.bellN)r"r#r$r*r-r.r r r r r&:sr&c@seZdZeddZddZeddZddd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZddZdS) FetchTestcCs tdtj|_|jjdS)NZgui)rtkZTkrootZwithdraw)r r r r r Gs zFetchTest.setUpClasscCsNt|j|_}|jdd|jdd|jddt||_tt g|j_dS)Nz1.0z>>> iomarkz1.4left) r&r1rinsertmark_setZ mark_gravityrr rr)rrr r r setUpMs     zFetchTest.setUpcCs|jj|`dS)N)r1Zdestroy)r r r r tearDownClassUs zFetchTest.tearDownClassF)r.cCsv|j}|j||j}||jjdd|||jj||rDd|j_||j|||j|||jjdddddS)Nr2zend-1cFr4z==r) r fetchrrgetr)rrZcompare)rreverselinerindexr.rZEqualr r r fetch_testZs   zFetchTest.fetch_testcCs<d}|j}|dt|d|dt|d|d|dddddS)NTrr)r.)r=rr)rrtestr r r test_fetch_prev_cyclicjs z FetchTest.test_fetch_prev_cycliccCs<d}|j}|dt|d|dt|d|d|dddddS)Nr>FrrT)r.)r=rr)rrr?r r r test_fetch_next_cyclicqs z FetchTest.test_fetch_next_cycliccCs:d}|jjd||jdt|d|jd|dddddS)Nrr2Tr)r.)rr4r=r)rrr r r test_fetch_prev_prefixysz FetchTest.test_fetch_prev_prefixcCs:d}|jjd||jdt|d|jd|dddddS)Nrr2FrT)r.)rr4r=r)rrr r r test_fetch_next_prefixsz FetchTest.test_fetch_next_prefixcCsDd}d|j_|j}|dt|d|dt|d|dt|ddddS)Nr>FTrr)r.)r rr=rr)rrr?r r r test_fetch_prev_noncyclics z#FetchTest.test_fetch_prev_noncycliccCsZd}d|j_|j}|d|dddd|dt|d|d|dddd|d|dddddS)Nr>FT)r.r)r rr=r)rrr?r r r test_fetch_next_noncyclicsz#FetchTest.test_fetch_next_noncycliccCs4|jjdd|jjdd|jdtdddddS)NT)r:r4r2)r.)r r8rr5r=r)rr r r test_fetch_cursor_movesz FetchTest.test_fetch_cursor_movecCs>|jjdd|jjdd|jjdd|jdtdddS)NT)r:r2r4za =r)r r8rrr4r=r)rr r r test_fetch_editszFetchTest.test_fetch_editcCs<|jjd|j|jjd|jjd|j|jjddS)Nz dummy eventr)r Z history_prevrrZ history_next)rr r r test_history_prev_nexts  z FetchTest.test_history_prev_nextN)r"r#r$r%r r6r7r=r@rArBrCrDrErFrGrHr r r r r/Ds   r/__main__) verbosityexit)Zidlelib.historyrZunittestZ test.supportrZtkinterr0rr(Zidlelib.idle_test.mock_tkrZidlelib.configrrrZTestCaserr&r/r"rr r r r s     * g