Your IP : 216.73.216.172


Current Path : /lib/python3/dist-packages/zope/component/tests/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/zope/component/tests/__pycache__/test_hookable.cpython-38.pyc

U

,�W�@s*dZddlZGdd�dej�Zdd�ZdS)zPure-Python hookable tests
�Nc@sdeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dS)�
HookableTestscCsddlm}|�t|�dS)Nr��hookable��zope.component.hookablerZassertRaises�	TypeError)�selfr�r	�D/usr/lib/python3/dist-packages/zope/component/tests/test_hookable.py�test_ctor_no_funcszHookableTests.test_ctor_no_funccCs@ddlm}dd�}||�}|�|j|k�|�|j|k�dS)NrrcSsdS�Nr	r	r	r	r
�foosz+HookableTests.test_ctor_simple.<locals>.foo)rr�
assertTrue�original�implementation�rrr
�hookedr	r	r
�test_ctor_simples
zHookableTests.test_ctor_simplecCs(ddlm}dd�}|�t|||�dS)NrrcSsdSrr	r	r	r	r
r
#sz.HookableTests.test_ctor_extra_arg.<locals>.foor�rrr
r	r	r
�test_ctor_extra_arg!sz!HookableTests.test_ctor_extra_argcCs*ddlm}dd�}|jt|||d�dS)NrrcSsdSrr	r	r	r	r
r
)sz3HookableTests.test_ctor_extra_arg_miss.<locals>.foo)Znonesuchrrr	r	r
�test_ctor_extra_arg_miss'sz&HookableTests.test_ctor_extra_arg_misscCsRddlm}dd�}dd�}||�}|�|�|�|j|k�|�|j|k�dS)NrrcSsdSrr	r	r	r	r
r
/sz'HookableTests.test_sethook.<locals>.foocSsdSrr	r	r	r	r
�bar1sz'HookableTests.test_sethook.<locals>.bar)rr�sethookrrr�rrr
rrr	r	r
�test_sethook-s
zHookableTests.test_sethookcCsZddlm}dd�}dd�}||�}|�|�|��|�|j|k�|�|j|k�dS)NrrcSsdSrr	r	r	r	r
r
:sz%HookableTests.test_reset.<locals>.foocSsdSrr	r	r	r	r
r<sz%HookableTests.test_reset.<locals>.bar)rrr�resetrrrrr	r	r
�
test_reset8s
zHookableTests.test_resetcCsdddlm}dd�}dd�}||�}z
||_Wn&tk
rBYntk
rTYnX|�d�dS)NrrcSsdSrr	r	r	r	r
r
Fsz4HookableTests.test_cant_assign_original.<locals>.foocSsdSrr	r	r	r	r
rHsz4HookableTests.test_cant_assign_original.<locals>.barzAssigned original�rrrr�AttributeError�failrr	r	r
�test_cant_assign_originalDs
z'HookableTests.test_cant_assign_originalcCsZddlm}dd�}||�}z|`Wn&tk
r8Yntk
rJYnX|�d�dS)NrrcSsdSrr	r	r	r	r
r
Vsz4HookableTests.test_cant_delete_original.<locals>.foozDeleted originalrrr	r	r
�test_cant_delete_originalTsz'HookableTests.test_cant_delete_originalcCsdddlm}dd�}dd�}||�}z
||_Wn&tk
rBYntk
rTYnX|�d�dS)NrrcSsdSrr	r	r	r	r
r
dsz:HookableTests.test_cant_assign_implementation.<locals>.foocSsdSrr	r	r	r	r
rfsz:HookableTests.test_cant_assign_implementation.<locals>.barzAssigned implementation�rrrrrrrr	r	r
�test_cant_assign_implementationbs
z-HookableTests.test_cant_assign_implementationcCsZddlm}dd�}||�}z|`Wn&tk
r8Yntk
rJYnX|�d�dS)NrrcSsdSrr	r	r	r	r
r
tsz:HookableTests.test_cant_delete_implementation.<locals>.foozDeleted implementationr"rr	r	r
�test_cant_delete_implementationrsz-HookableTests.test_cant_delete_implementationcsLddlm}g��fdd�}||�}|dddd�|��d	d
difg�dS)Nrrcs��||f�dSr)�append)�args�kw�Z_calledr	r
r
�sz-HookableTests.test_ctor___call__.<locals>.foo�one�twoZbaz)r)r)r*r)rrZassertEqualrr	r(r
�test_ctor___call__�sz HookableTests.test_ctor___call__N)�__name__�
__module__�__qualname__rrrrrrr r!r#r$r+r	r	r	r
rsrcCst�t�t�f�Sr)�unittestZ	TestSuiteZ	makeSuiterr	r	r	r
�
test_suite�s�r0)�__doc__r/ZTestCaserr0r	r	r	r
�<module>sw