Your IP : 3.140.188.195


Current Path : /opt/alt/python36/lib64/python3.6/idlelib/idle_test/__pycache__/
Upload File :
Current File : //opt/alt/python36/lib64/python3.6/idlelib/idle_test/__pycache__/test_history.cpython-36.pyc

3

� f��@s�dZddlmZddlZddlmZddlZddlmZ	ddl
mZddlm
Z
dZdZGd	d
�d
ej�ZGdd�d�ZGd
d�dej�Zedkr�ejddd�dS)z Test history, coverage 100%.�)�HistoryN)�requires)�Text)�idleConfza = 7zb = ac@sDeZdZdZedd��Zdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
dS)�	StoreTestz7Tests History.__init__ and History.store with mock TextcCst�|_t|j�|_dS)N)�mkText�textr�history)�cls�r�C/opt/alt/python36/lib64/python3.6/idlelib/idle_test/test_history.py�
setUpClassszStoreTest.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_initcCs<|jjd�|j|jjg�|jjd�|j|jjg�dS)N�az  a  )r	�storer)rrrr�test_store_short$szStoreTest.test_store_shortcCsb|jjt�|j|jjtg�|jjt�|j|jjttg�|jjt�|j|jjttg�dS)N)r	r�line1r�line2)rrrr�test_store_dup*szStoreTest.test_store_dupcCs<t|j_d|j_|jjt�|j|jj�|j|jj�dS)Nr)rr	rrrrr)rrrr�test_store_reset2s
zStoreTest.test_store_resetN)�__name__�
__module__�__qualname__�__doc__�classmethodr
rrrr r!rrrrrsrc@s$eZdZdd�Zdd�Zdd�ZdS)�TextWrappercCst|d�|_d|_dS)N)�masterF)�tkTextr�_bell)rr(rrr�__init__;szTextWrapper.__init__cCst|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':sr'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.
    cCs td�tj�|_|jj�dS)NZgui)r�tkZTk�rootZwithdraw)r
rrrr
Gs
zFetchTest.setUpClasscCsNt|j�|_}|jdd�|jdd�|jdd�t|�|_tt	g|j_dS)Nz1.0z>>> �iomarkz1.4�left)
r'r2r�insert�mark_setZmark_gravityrr	rr)rrrrr�setUpMs
zFetchTest.setUpcCs|jj�|`dS)N)r2Zdestroy)r
rrr�
tearDownClassUs
zFetchTest.tearDownClassF)r/cCsv|j}|j|�|j}||jjdd�|�||jj|�|rDd|j_||j|�||j|�||jjddd�d�dS)Nr3zend-1cFr5z==r)	r	�fetchrr�getr*rrZcompare)r�reverse�liner�indexr/rZEqualrrr�
fetch_testZs
zFetchTest.fetch_testcCs<d}|j}|dt|d�|dt|d�|d|dddd�dS)N�Trr)r/)r>rr)rr�testrrr�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@rrr�test_fetch_next_cyclicqs
z FetchTest.test_fetch_next_cycliccCs:d}|jjd|�|jdt|d�|jd|dddd�dS)Nrr3Tr)r/)rr5r>r)rrrrr�test_fetch_prev_prefixysz FetchTest.test_fetch_prev_prefixcCs:d}|jjd|�|jdt|d�|jd|dddd�dS)Nrr3FrT)r/)rr5r>r)rrrrr�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@rrr�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@rrr�test_fetch_next_noncyclic�sz#FetchTest.test_fetch_next_noncycliccCs4|jjdd�|jjdd�|jdtdddd�dS)NT)r;r5r3)r/)r	r9rr6r>r)rrrr�test_fetch_cursor_move�sz FetchTest.test_fetch_cursor_movecCs>|jjdd�|jjdd�|jjdd�|jdtdd�dS)NT)r;r3r5za =r)r	r9rrr5r>r)rrrr�test_fetch_edit�szFetchTest.test_fetch_editcCs<|jjd�|j|jjd�|jjd�|j|jjd�dS)Nzdummy eventr)r	Zhistory_prevrrZhistory_next)rrrr�test_history_prev_next�sz FetchTest.test_history_prev_nextN)r"r#r$r%r&r
r7r8r>rArBrCrDrErFrGrHrIrrrrr0Ds	r0�__main__�)�	verbosity�exit)r%Zidlelib.historyrZunittestZtest.supportrZtkinterr1rr)Zidlelib.idle_test.mock_tkrZidlelib.configrrrZTestCaserr'r0r"rrrrr�<module>s*
g

?>