Your IP : 3.137.175.166


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_widgetredir.cpython-34.pyc

�
e f �@s�dZddlmZddlZddlmZddlmZmZm	Z	ddl
mZGdd�dej�Z
Gd	d
�d
ej�Zedkr�ejdd
�ndS)z5Unittest for idlelib.WidgetRedirector

100% coverage
�)�requiresN)�Func)�Tk�Text�TclError)�WidgetRedirectorc@sLeZdZedd��Zedd��Zdd�Zdd�Zd	S)
�
InitCloseTestcCs,td�t�|_t|j�|_dS)N�gui)rr�tkr�text)�cls�r
�G/opt/alt/python34/lib64/python3.4/idlelib/idle_test/test_widgetredir.py�
setUpClasss
zInitCloseTest.setUpClasscCs*|jj�|jj�|`|`dS)N)r�destroyr
)rr
r
r�
tearDownClasss

zInitCloseTest.tearDownClasscCsbt|j�}|j|j|j�|j|j|jj�|jtt|j�|j�dS)N)rr�assertEqual�widgetr
ZassertRaisesr�close)�self�redirr
r
r�	test_inits
zInitCloseTest.test_initcCsYt|j�}|jdt�|j�|j|ji�|jt|jd��dS)N�insertr)	rr�registerrrr�_operations�assertFalse�hasattr)rrr
r
r�
test_close!s

zInitCloseTest.test_closeN)�__name__�
__module__�__qualname__�classmethodrrrrr
r
r
rrsrc@s�eZdZedd��Zedd��Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)�WidgetRedirectorTestcCs,td�t�|_t|j�|_dS)Nr	)rrr
rr)rr
r
rr+s
zWidgetRedirectorTest.setUpClasscCs*|jj�|jj�|`|`dS)N)rrr
)rr
r
rr1s

z"WidgetRedirectorTest.tearDownClasscCsPt|j�|_t�|_|jjd|j�|_|jjdd�dS)Nr�asdf)rrrr�funcr�orig_insertr)rr
r
r�setUp7szWidgetRedirectorTest.setUpcCs$|jjdd�|jj�dS)Nz1.0�end)r�deleterr)rr
r
r�tearDown=szWidgetRedirectorTest.tearDowncCs6|jdt|j��|jdt|j��dS)NZ
RedirectorZOriginal)�assertIn�reprrr%)rr
r
r�	test_reprAszWidgetRedirectorTest.test_reprcCs~|j|jjdd�d�|j|jjd�|jd|jj�|jd|jj�|j|jj	|j�dS)Nz1.0r'�
rr#)zinsertzasdf)
rr�getr$�argsr*rr�__dict__r)rr
r
r�
test_registerEs
z"WidgetRedirectorTest.test_registercCsh|j|jjd�|j|jj|jjj�|jdd�|j|jjdd�d�dS)Nrr#z1.0r'zasdf
)rr%Z	operationZtk_callrr
�callr.)rr
r
r�test_original_commandLsz*WidgetRedirectorTest.test_original_commandcCsh|j|jjd��|j|jjd�|j�|jd|jj�|jd|jj�dS)Nzinvalid operation namer)	ZassertIsNoner�
unregisterrr$ZassertNotInrrr0)rr
r
r�test_unregisterRsz$WidgetRedirectorTest.test_unregistercCs,|j`|j|jjd�|j�dS)Nr)rrrrr4r$)rr
r
r�test_unregister_no_attributeXs	z1WidgetRedirectorTest.test_unregister_no_attributecCsG|jjd�|j|jjdd��|j|jjd�dS)NTrFr)r$�__init__Z
assertTruer�dispatchrr/)rr
r
r�test_dispatch_intercept\sz,WidgetRedirectorTest.test_dispatch_interceptcCsU|jdd�|j|jjddd�d�|j|jjdd�d�dS)Nrr#r(z1.0r'�r-)r%rrr8rr.)rr
r
r�test_dispatch_bypassas"z)WidgetRedirectorTest.test_dispatch_bypasscCsR|jjt��|j|jjdd�d�|j|jjd�d�dS)NrFr:Zinvalid)r$r7rrrr8)rr
r
r�test_dispatch_errorgsz(WidgetRedirectorTest.test_dispatch_errorcCs�|jj|jjdd�|j|jjd�|j|jjdd�d�|jjt	��|j|jj|jjdd�d�dS)	Nr�helloz1.0r'r-Zboor:)r=)
r
r2rZ_wrr$r/r.r7r)rr
r
r�test_command_dispatchls
z*WidgetRedirectorTest.test_command_dispatchN)rrr r!rrr&r)r,r1r3r5r6r9r;r<r>r
r
r
rr")sr"�__main__�	verbosity�)�__doc__Ztest.supportrZunittestZidlelib.idle_test.mock_idlerZtkinterrrrZidlelib.WidgetRedirectorrZTestCaserr"r�mainr
r
r
r�<module>sP

?>