[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@52.14.120.226: ~ $


��Yf��@s�dZddlmZed�ddlZddlmZddlmZmZddl	m
Z
ddlmZGd	d
�d
ej
�Zedkr�ejdd
dd�dS)zSUnittest for UndoDelegator in idlelib.UndoDelegator.

Coverage about 80% (retest).
�)�requiresZguiN)�Mock)�Text�Tk)�
UndoDelegator)�
Percolatorc@s�eZdZedd��Zedd��Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dS)�UndoDelegatorTestcCs4t�|_t|j�|_t|j�|_dS)N)r�rootr�textr�
percolator)�cls�r
�I/opt/alt/python35/lib64/python3.5/idlelib/idle_test/test_undodelegator.py�
setUpClassszUndoDelegatorTest.setUpClasscCs3|jjj�|`|`|jj�|`dS)N)rZredir�closer
r	Zdestroy)rr
r
r�
tearDownClasss
zUndoDelegatorTest.tearDownClasscCs>t�|_|jj|j�td|jj�|j_dS)N�wraps)r�	delegatorrZinsertfilterr�bell)�selfr
r
r�setUpszUndoDelegatorTest.setUpcCs7|jj|j�|jjdd�|jj�dS)Nz1.0�end)rZremovefilterrr
�deleteZ
resetcache)rr
r
r�tearDown#szUndoDelegatorTest.tearDowncCsD|j}|jdd�|jdd�|jd�|j|jdd�d�|jdd�|jdd	�|jd
d�|jdd�|jd�|j|jdd�d
�|jd�|j|jdd�d�|jd�|j|jdd�d�|jd�|jjd�|j|jj	j
�dS)N�insertZfoobar�hz<<undo>>z1.0r�
�foo�barz1.2z1.4ZhelloZfoarz1.6z1.3Zevent)r
r�event_generate�assertEqual�getrrZ
undo_event�
assertTruer�called)rr
r
r
r�test_undo_event(s$	




z!UndoDelegatorTest.test_undo_eventcCs�|j}|jdd�|jdd�|jdd�|jd�|jd�|j|jdd�d�|jd�|j|jjj	�dS)Nrrrz1.0z1.3z<<undo>>z<<redo>>)
r
rrrr r!r"rrr#)rr
r
r
r�test_redo_event>s	


z!UndoDelegatorTest.test_redo_eventcCs�|j}|j}|jdd�|jdd�|jdd�|j|j|jfd�|jd�|j|j|jfd
�dS)z�
        Dump_event cannot be tested directly without changing
        environment variables. So, test statements in dump_event
        indirectly
        rrrz1.2z1.4�Tz<<undo>>�FN)r&T)r'F)r
rrrZassertTupleEqual�pointerZ	can_merger)rr
�dr
r
r�test_dump_eventJs		
z!UndoDelegatorTest.test_dump_eventcCs�|j}|j|j��|jjdd�|j|j��t�|_|jd�|j	|j
|j�|j|jj�|jd�|j	|jd�|j|jj�dS)Nr�aTF����)
rr"Z	get_savedr
rZassertFalserZsaved_change_hookZ	set_savedr r(Zsavedr#)rr)r
r
r�test_get_set_savedZs	

z$UndoDelegatorTest.test_get_set_savedcCs�|j}|jdd�|jj�|jdd�|jdd�|jj�|j|jdd�d�|jj�|jdd�|jj�|j|jdd�d�dS)Nrrrz1.0z1.3)r
rrZundo_block_startZundo_block_stopr r!)rr
r
r
r�test_undo_start_stopms	



z&UndoDelegatorTest.test_undo_start_stopcCsd|j}d|j_}xDt|d�D]2}|jdd�|jt|jj�|�q*WdS)N�
rr)r
r�max_undo�rangerZassertLessEqual�lenZundolist)rr
r1�ir
r
r�test_addcmd~s
	zUndoDelegatorTest.test_addcmdN)�__name__�
__module__�__qualname__�classmethodrrrrr$r%r*r.r/r5r
r
r
rrsr�__main__�	verbosityr'�exitF)�__doc__Ztest.supportrZunittestZ
unittest.mockrZtkinterrrZidlelib.UndoDelegatorrZidlelib.PercolatorrZTestCaserr6�mainr
r
r
r�<module>s
w

Filemanager

Name Type Size Permission Actions
__init__.cpython-35.opt-1.pyc File 823 B 0644
__init__.cpython-35.opt-2.pyc File 496 B 0644
__init__.cpython-35.pyc File 823 B 0644
htest.cpython-35.opt-1.pyc File 11.44 KB 0644
htest.cpython-35.opt-2.pyc File 9.17 KB 0644
htest.cpython-35.pyc File 11.44 KB 0644
mock_idle.cpython-35.opt-1.pyc File 2.4 KB 0644
mock_idle.cpython-35.opt-2.pyc File 1.71 KB 0644
mock_idle.cpython-35.pyc File 2.4 KB 0644
mock_tk.cpython-35.opt-1.pyc File 11.12 KB 0644
mock_tk.cpython-35.opt-2.pyc File 6.29 KB 0644
mock_tk.cpython-35.pyc File 11.12 KB 0644
test_autocomplete.cpython-35.opt-1.pyc File 4.95 KB 0644
test_autocomplete.cpython-35.opt-2.pyc File 4.93 KB 0644
test_autocomplete.cpython-35.pyc File 4.95 KB 0644
test_autoexpand.cpython-35.opt-1.pyc File 4.13 KB 0644
test_autoexpand.cpython-35.opt-2.pyc File 4.06 KB 0644
test_autoexpand.cpython-35.pyc File 4.13 KB 0644
test_calltips.cpython-35.opt-1.pyc File 10.01 KB 0644
test_calltips.cpython-35.opt-2.pyc File 9.88 KB 0644
test_calltips.cpython-35.pyc File 10.09 KB 0644
test_config_help.cpython-35.opt-1.pyc File 4.31 KB 0644
test_config_help.cpython-35.opt-2.pyc File 4.23 KB 0644
test_config_help.cpython-35.pyc File 4.31 KB 0644
test_config_name.cpython-35.opt-1.pyc File 3.16 KB 0644
test_config_name.cpython-35.opt-2.pyc File 3.08 KB 0644
test_config_name.cpython-35.pyc File 3.16 KB 0644
test_configdialog.cpython-35.opt-1.pyc File 1.43 KB 0644
test_configdialog.cpython-35.opt-2.pyc File 1.27 KB 0644
test_configdialog.cpython-35.pyc File 1.43 KB 0644
test_delegator.cpython-35.opt-1.pyc File 1.1 KB 0644
test_delegator.cpython-35.opt-2.pyc File 1.09 KB 0644
test_delegator.cpython-35.pyc File 1.1 KB 0644
test_editmenu.cpython-35.opt-1.pyc File 2.88 KB 0644
test_editmenu.cpython-35.opt-2.pyc File 2.48 KB 0644
test_editmenu.cpython-35.pyc File 2.88 KB 0644
test_editor.cpython-35.opt-1.pyc File 1.19 KB 0644
test_editor.cpython-35.opt-2.pyc File 1.17 KB 0644
test_editor.cpython-35.pyc File 1.19 KB 0644
test_formatparagraph.cpython-35.opt-1.pyc File 12.41 KB 0644
test_formatparagraph.cpython-35.opt-2.pyc File 11.65 KB 0644
test_formatparagraph.cpython-35.pyc File 12.41 KB 0644
test_grep.cpython-35.opt-1.pyc File 3.08 KB 0644
test_grep.cpython-35.opt-2.pyc File 2.54 KB 0644
test_grep.cpython-35.pyc File 3.08 KB 0644
test_help_about.cpython-35.opt-1.pyc File 1.96 KB 0644
test_help_about.cpython-35.opt-2.pyc File 1.82 KB 0644
test_help_about.cpython-35.pyc File 1.96 KB 0644
test_hyperparser.cpython-35.opt-1.pyc File 8 KB 0644
test_hyperparser.cpython-35.opt-2.pyc File 7.81 KB 0644
test_hyperparser.cpython-35.pyc File 8 KB 0644
test_idlehistory.cpython-35.opt-1.pyc File 6.72 KB 0644
test_idlehistory.cpython-35.opt-2.pyc File 6.57 KB 0644
test_idlehistory.cpython-35.pyc File 6.72 KB 0644
test_io.cpython-35.opt-1.pyc File 8.76 KB 0644
test_io.cpython-35.opt-2.pyc File 8.75 KB 0644
test_io.cpython-35.pyc File 8.76 KB 0644
test_parenmatch.cpython-35.opt-1.pyc File 4.06 KB 0644
test_parenmatch.cpython-35.opt-2.pyc File 3.61 KB 0644
test_parenmatch.cpython-35.pyc File 4.06 KB 0644
test_pathbrowser.cpython-35.opt-1.pyc File 1.31 KB 0644
test_pathbrowser.cpython-35.opt-2.pyc File 1.29 KB 0644
test_pathbrowser.cpython-35.pyc File 1.31 KB 0644
test_percolator.cpython-35.opt-1.pyc File 5.18 KB 0644
test_percolator.cpython-35.opt-2.pyc File 5.13 KB 0644
test_percolator.cpython-35.pyc File 5.18 KB 0644
test_replacedialog.cpython-35.opt-1.pyc File 7.5 KB 0644
test_replacedialog.cpython-35.opt-2.pyc File 7.43 KB 0644
test_replacedialog.cpython-35.pyc File 7.5 KB 0644
test_rstrip.cpython-35.opt-1.pyc File 1.55 KB 0644
test_rstrip.cpython-35.opt-2.pyc File 1.54 KB 0644
test_rstrip.cpython-35.pyc File 1.55 KB 0644
test_searchdialog.cpython-35.opt-1.pyc File 2.42 KB 0644
test_searchdialog.cpython-35.opt-2.pyc File 2.34 KB 0644
test_searchdialog.cpython-35.pyc File 2.42 KB 0644
test_searchdialogbase.cpython-35.opt-1.pyc File 5.79 KB 0644
test_searchdialogbase.cpython-35.opt-2.pyc File 5.58 KB 0644
test_searchdialogbase.cpython-35.pyc File 5.79 KB 0644
test_searchengine.cpython-35.opt-1.pyc File 10.7 KB 0644
test_searchengine.cpython-35.opt-2.pyc File 10.61 KB 0644
test_searchengine.cpython-35.pyc File 10.7 KB 0644
test_text.cpython-35.opt-1.pyc File 6.86 KB 0644
test_text.cpython-35.opt-2.pyc File 6.84 KB 0644
test_text.cpython-35.pyc File 6.86 KB 0644
test_textview.cpython-35.opt-1.pyc File 3.86 KB 0644
test_textview.cpython-35.opt-2.pyc File 3.53 KB 0644
test_textview.cpython-35.pyc File 3.86 KB 0644
test_undodelegator.cpython-35.opt-1.pyc File 4.57 KB 0644
test_undodelegator.cpython-35.opt-2.pyc File 4.3 KB 0644
test_undodelegator.cpython-35.pyc File 4.57 KB 0644
test_warning.cpython-35.opt-1.pyc File 2.84 KB 0644
test_warning.cpython-35.opt-2.pyc File 2.5 KB 0644
test_warning.cpython-35.pyc File 2.84 KB 0644
test_widgetredir.cpython-35.opt-1.pyc File 5.49 KB 0644
test_widgetredir.cpython-35.opt-2.pyc File 5.4 KB 0644
test_widgetredir.cpython-35.pyc File 5.49 KB 0644