3 Õì2a�ã@s ddlmZddlZddlmZddlZddlmZddl mZ ddl m Z dZ dZGdd „d ejƒZGd d „d ƒZGd d „d ejƒZedkrœejddd�dS)é)ÚHistoryN)Úrequires)ÚText)ÚidleConfza = 7zb = ac@s@eZdZedd„ƒZdd„Zdd„Zdd„Zd d „Zd d „Z d S)Ú StoreTestcCstƒ|_t|jƒ|_dS)N)ÚmkTextÚtextrÚhistory)Úcls©r ú1/opt/alt/python36/lib64/python3.6/test_history.pyÚ setUpClassszStoreTest.setUpClasscCs|jjddƒg|j_dS)Nz1.0Úend)rÚdeleter )Úselfr r r ÚtearDownszStoreTest.tearDowncCs`|j|jj|jƒ|j|jjgƒ|j|jjƒ|j|jjƒ|j|jjtj dddddƒƒdS)NÚmainrÚcyclicéÚbool) ZassertIsr rÚ assertEqualÚ assertIsNoneÚprefixÚpointerrrZ GetOption)rr r r Ú test_inits  zStoreTest.test_initcCs<|jjdƒ|j|jjgƒ|jjdƒ|j|jjgƒdS)NÚaz a )r Ústorer)rr r r Útest_store_short$s  zStoreTest.test_store_shortcCsb|jjtƒ|j|jjtgƒ|jjtƒ|j|jjttgƒ|jjtƒ|j|jjttgƒdS)N)r rÚline1rÚline2)rr r r Útest_store_dup*s    zStoreTest.test_store_dupcCs<t|j_d|j_|jjtƒ|j|jjƒ|j|jjƒdS)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$eZdZdd„Zdd„Zdd„ZdS)Ú TextWrappercCst|d�|_d|_dS)N)ÚmasterF)ÚtkTextrÚ_bell)rr'r r r Ú__init__;s zTextWrapper.__init__cCs t|j|ƒS)N)Úgetattrr)rÚnamer 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@s‚eZdZedd„ƒZdd„Zedd„ƒZddœd d „Zd d „Zd d„Z dd„Z dd„Z dd„Z dd„Z dd„Zdd„Zdd„ZdS)Ú FetchTestcCs tdƒtjƒ|_|jjƒdS)NZgui)rÚtkZTkÚrootZwithdraw)r r r r r Gs zFetchTest.setUpClasscCsNt|jƒ|_}|jddƒ|jddƒ|jddƒt|ƒ|_tt g|j_dS)Nz1.0z>>> Úiomarkz1.4Úleft) r&r1rÚinsertÚmark_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|ƒ||jjdddƒdƒdS)Nr2zend-1cFr4z==r) r ÚfetchrrÚgetr)rrZcompare)rÚreverseÚlinerÚindexr.rZEqualr r r Ú fetch_testZs   zFetchTest.fetch_testcCs<d}|j}|dt|dƒ|dt|dƒ|d|dddd�dS)NÚTrr)r.)r=rr)rrÚtestr r r Útest_fetch_prev_cyclicjs z FetchTest.test_fetch_prev_cycliccCs<d}|j}|dt|dƒ|dt|dƒ|d|dddd�dS)Nr>FrrT)r.)r=rr)rrr?r r r Útest_fetch_next_cyclicqs z FetchTest.test_fetch_next_cycliccCs:d}|jjd|ƒ|jdt|dƒ|jd|dddd�dS)Nrr2Tr)r.)rr4r=r)rrr r r Útest_fetch_prev_prefixysz FetchTest.test_fetch_prev_prefixcCs:d}|jjd|ƒ|jdt|dƒ|jd|dddd�dS)Nrr2FrT)r.)rr4r=r)rrr r r Útest_fetch_next_prefixsz FetchTest.test_fetch_next_prefixcCsDd}d|j_|j}|dt|dƒ|dt|dƒ|dt|ddd�dS)Nr>FTrr)r.)r rr=rr)rrr?r r r Útest_fetch_prev_noncyclic…s z#FetchTest.test_fetch_prev_noncycliccCsZd}d|j_|j}|d|dddd�|dt|dƒ|d|dddd�|d|dddd�dS)Nr>FT)r.r)r rr=r)rrr?r r r Útest_fetch_next_noncyclic�sz#FetchTest.test_fetch_next_noncycliccCs4|jjdd�|jjddƒ|jdtdddd�dS)NT)r:r4r2)r.)r r8rr5r=r)rr r r Útest_fetch_cursor_move–sz FetchTest.test_fetch_cursor_movecCs>|jjdd�|jjddƒ|jjddƒ|jdtddƒdS)NT)r:r2r4za =r)r r8rrr4r=r)rr r r Útest_fetch_editœszFetchTest.test_fetch_editcCs<|jjdƒ|j|jjdƒ|jjdƒ|j|jjdƒdS)Nz dummy eventr)r Z history_prevrrZ history_next)rr r r Útest_history_prev_next£s  z FetchTest.test_history_prev_nextN)r"r#r$r%r r6r7r=r@rArBrCrDrErFrGrHr r r r r/Ds   r/Ú__main__é)Ú verbosityÚexit)Zidlelib.historyrZunittestZ test.supportrZtkinterr0rr(Zidlelib.idle_test.mock_tkrZidlelib.configrrrZTestCaserr&r/r"rr r r r Ús     * g