B YI~d�ã@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 úC/opt/alt/python37/lib64/python3.7/idlelib/idle_test/test_history.pyÚ setUpClassszStoreTest.setUpClasscCs|j dd¡g|j_dS)Nz1.0Úend)rÚdeleter )Úselfr r r ÚtearDownszStoreTest.tearDownc Cs`| |jj|j¡| |jjg¡| |jj¡| |jj¡| |jjt  ddddd¡¡dS)NÚmainrÚcyclicéÚbool) ZassertIsr rÚ assertEqualÚ assertIsNoneÚprefixÚpointerrrZ GetOption)rr r r Ú test_inits  zStoreTest.test_initcCs<|j d¡| |jjg¡|j d¡| |jjg¡dS)NÚaz a )r Ústorer)rr r r Útest_store_short$s  zStoreTest.test_store_shortcCsb|j t¡| |jjtg¡|j t¡| |jjttg¡|j t¡| |jjttg¡dS)N)r rÚline1rÚline2)rr r r Útest_store_dup*s    zStoreTest.test_store_dupcCs<t|j_d|j_|j t¡| |jj¡| |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ƒt ¡|_|j ¡dS)NZgui)rÚtkZTkÚrootZwithdraw)r r r r r Gs zFetchTest.setUpClasscCsNt|jƒ|_}| dd¡| dd¡| dd¡t|ƒ|_tt g|j_dS)Nz1.0z>>> Úiomarkz1.4Úleft) r&r1rÚinsertÚmark_setZ mark_gravityrr rr)rrr r r ÚsetUpMs     zFetchTest.setUpcCs|j ¡|`dS)N)r1Zdestroy)r r r r Ú tearDownClassUs zFetchTest.tearDownClassF)r.cCsv|j}| |¡|j}||j dd¡|ƒ||jj|ƒ|rDd|j_||j|ƒ||j|ƒ||j ddd¡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}|j d|¡| dt|d¡|jd|dddd�dS)Nrr2Tr)r.)rr4r=r)rrr r r Útest_fetch_prev_prefixysz FetchTest.test_fetch_prev_prefixcCs:d}|j d|¡| dt|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�|j dd¡|jdtdddd�dS)NT)r:r4r2)r.)r r8rr5r=r)rr r r Útest_fetch_cursor_move–sz FetchTest.test_fetch_cursor_movecCs>|jjdd�|j dd¡|j dd¡| dtdd¡dS)NT)r:r2r4za =r)r r8rrr4r=r)rr r r Útest_fetch_editœszFetchTest.test_fetch_editcCs<|j d¡| |jjd¡|j d¡| |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