Your IP : 18.119.124.204


Current Path : /opt/alt/python34/lib64/python3.4/idlelib/idle_test/__pycache__/
Upload File :
Current File : //opt/alt/python34/lib64/python3.4/idlelib/idle_test/__pycache__/test_idlehistory.cpython-34.pyc

�
e fY�@s�ddlZddlmZddlZddlmZddlmZddl	m
Z
ddlmZdZ
dZGdd	�d	ej�ZGd
d�d�ZGdd
�d
ej�Zedkr�ejdddd�ndS)�N)�requires)�Text)�History)�idleConfza = 7zb = ac@sdeZdZdZedd��Zdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
dS)�	StoreTestz7Tests History.__init__ and History.store with mock TextcCs"t�|_t|j�|_dS)N)�mkText�textr�history)�cls�r�G/opt/alt/python34/lib64/python3.4/idlelib/idle_test/test_idlehistory.py�
setUpClassszStoreTest.setUpClasscCs#|jjdd�g|j_dS)Nz1.0�end)r�deleter	)�selfrrr�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)rrrr�	test_initszStoreTest.test_initcCsP|jjd�|j|jjg�|jjd�|j|jjg�dS)N�az  a  )r	�storer)rrrr�test_store_short!szStoreTest.test_store_shortcCs�|jjt�|j|jjtg�|jjt�|j|jjttg�|jjt�|j|jjttg�dS)N)r	r�line1r�line2)rrrr�test_store_dup'szStoreTest.test_store_dupcCsRt|j_d|j_|jjt�|j|jj�|j|jj�dS)Nr)rr	rrrrr)rrrr�test_store_reset/s
zStoreTest.test_store_resetN)�__name__�
__module__�__qualname__�__doc__�classmethodr
rrrr r!rrrrr
src@s4eZdZdd�Zdd�Zdd�ZdS)�TextWrappercCstd|�|_d|_dS)N�masterF)�tkTextr�_bell)rr(rrr�__init__8szTextWrapper.__init__cCst|j|�S)N)�getattrr)r�namerrr�__getattr__;szTextWrapper.__getattr__cCs
d|_dS)NT)r*)rrrr�bell=szTextWrapper.bellN)r"r#r$r+r.r/rrrrr'7sr'c@s�eZdZdZedd��Zdd�Zedd��Zdd	d
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�ZdS)�	FetchTestz-Test History.fetch with wrapped tk.Text.
    cCstd�tj�|_dS)NZgui)r�tkZTk�root)r
rrrr
Cs
zFetchTest.setUpClasscCskt|j�|_}|jdd�|jdd�|jdd�t|�|_tt	g|j_dS)Nz1.0z>>> �iomarkz1.4�left)
r'r2r�insert�mark_setZmark_gravityrr	rr)rrrrr�setUpHszFetchTest.setUpcCs|jj�|`dS)N)r2Zdestroy)r
rrr�
tearDownClassPs
zFetchTest.tearDownClassr/FcCs�|j}|j|�|j}||jjdd�|�||jj|�|rcd|j_n||j|�||j|�||jjddd�d�dS)Nr3zend-1cFr5z==r)	r	�fetchrr�getr*rrZcompare)r�reverse�liner�indexr/rZEqualrrr�
fetch_testUs	
	zFetchTest.fetch_testcCsRd}|j}|dt|d�|dt|d�|d|dddd�dS)N�Trrr/)r>rr)rr�testrrr�test_fetch_prev_cyclices
	z FetchTest.test_fetch_prev_cycliccCsRd}|j}|dt|d�|dt|d�|d|dddd�dS)Nr?Frrr/T)r>rr)rrr@rrr�test_fetch_next_cyclicls
	z FetchTest.test_fetch_next_cycliccCsOd}|jjd|�|jdt|d�|jd|dddd�dS)Nrr3Trr/)rr5r>r)rrrrr�test_fetch_prev_prefixtsz FetchTest.test_fetch_prev_prefixcCsOd}|jjd|�|jdt|d�|jd|dddd�dS)Nrr3Frr/T)rr5r>r)rrrrr�test_fetch_next_prefixzsz FetchTest.test_fetch_next_prefixcCs^d}d|j_|j}|dt|d�|dt|d�|dt|ddd�dS)Nr?FTrrr/)r	rr>rr)rrr@rrr�test_fetch_prev_noncyclic�s	z#FetchTest.test_fetch_prev_noncycliccCs}d}d|j_|j}|d|dddd�|dt|d�|d|dddd�|d|dddd�dS)Nr?Fr/Tr)r	rr>r)rrr@rrr�test_fetch_next_noncyclic�s	z#FetchTest.test_fetch_next_noncycliccCsF|jjdd�|jjdd�|jdtdddd�dS)Nr;Tr5r3r/)r	r9rr6r>r)rrrr�test_fetch_cursor_move�sz FetchTest.test_fetch_cursor_movecCsS|jjdd�|jjdd�|jjdd�|jdtdd�dS)Nr;Tr3r5za =r)r	r9rrr5r>r)rrrr�test_fetch_edit�szFetchTest.test_fetch_editcCsP|jjd�|j|jjd�|jjd�|j|jjd�dS)Nzdummy eventr)r	Zhistory_prevrrZhistory_next)rrrr�test_history_prev_next�sz FetchTest.test_history_prev_nextN)r"r#r$r%r&r
r7r8r>rArBrCrDrErFrGrHrIrrrrr0@s	r0�__main__�	verbosity��exit)ZunittestZtest.supportrZtkinterr1rr)Zidlelib.idle_test.mock_tkrZidlelib.IdleHistoryrZidlelib.configHandlerrrrZTestCaserr'r0r"rrrrr�<module>s*	f

?>