HEX
Server: LiteSpeed
System: Linux cluster02.load-balancer.x2.network 4.18.0-553.51.1.lve.1.el8.x86_64 #1 SMP Wed May 14 14:34:57 UTC 2025 x86_64
User: kbdhpghp (1098)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //lib/python3.6/site-packages/zope/component/tests/__pycache__/test_hookable.cpython-36.opt-1.pyc
3

,�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}|jt|�dS)Nr)�hookable)�zope.component.hookabler�assertRaises�	TypeError)�selfr�r�#/usr/lib/python3.6/test_hookable.py�test_ctor_no_funcszHookableTests.test_ctor_no_funccCs@ddlm}dd�}||�}|j|j|k�|j|j|k�dS)Nr)rcSsdS)Nrrrrr	�foosz+HookableTests.test_ctor_simple.<locals>.foo)rr�
assertTrue�original�implementation)rrr�hookedrrr	�test_ctor_simples
zHookableTests.test_ctor_simplecCs(ddlm}dd�}|jt|||�dS)Nr)rcSsdS)Nrrrrr	r#sz.HookableTests.test_ctor_extra_arg.<locals>.foo)rrrr)rrrrrr	�test_ctor_extra_arg!sz!HookableTests.test_ctor_extra_argcCs*ddlm}dd�}|jt|||d�dS)Nr)rcSsdS)Nrrrrr	r)sz3HookableTests.test_ctor_extra_arg_miss.<locals>.foo)Znonesuch)rrrr)rrrrrr	�test_ctor_extra_arg_miss'sz&HookableTests.test_ctor_extra_arg_misscCsRddlm}dd�}dd�}||�}|j|�|j|j|k�|j|j|k�dS)Nr)rcSsdS)Nrrrrr	r/sz'HookableTests.test_sethook.<locals>.foocSsdS)Nrrrrr	�bar1sz'HookableTests.test_sethook.<locals>.bar)rr�sethookrr
r)rrrrrrrr	�test_sethook-s
zHookableTests.test_sethookcCsZddlm}dd�}dd�}||�}|j|�|j�|j|j|k�|j|j|k�dS)Nr)rcSsdS)Nrrrrr	r:sz%HookableTests.test_reset.<locals>.foocSsdS)Nrrrrr	r<sz%HookableTests.test_reset.<locals>.bar)rrr�resetrr
r)rrrrrrrr	�
test_reset8s
zHookableTests.test_resetcCsdddlm}dd�}dd�}||�}y
||_Wn&tk
rBYntk
rTYnX|jd�dS)Nr)rcSsdS)Nrrrrr	rFsz4HookableTests.test_cant_assign_original.<locals>.foocSsdS)Nrrrrr	rHsz4HookableTests.test_cant_assign_original.<locals>.barzAssigned original)rrr
r�AttributeError�fail)rrrrrrrr	�test_cant_assign_originalDs
z'HookableTests.test_cant_assign_originalcCsZddlm}dd�}||�}y|`Wn&tk
r8Yntk
rJYnX|jd�dS)Nr)rcSsdS)Nrrrrr	rVsz4HookableTests.test_cant_delete_original.<locals>.foozDeleted original)rrr
rrr)rrrrrrr	�test_cant_delete_originalTsz'HookableTests.test_cant_delete_originalcCsdddlm}dd�}dd�}||�}y
||_Wn&tk
rBYntk
rTYnX|jd�dS)Nr)rcSsdS)Nrrrrr	rdsz:HookableTests.test_cant_assign_implementation.<locals>.foocSsdS)Nrrrrr	rfsz:HookableTests.test_cant_assign_implementation.<locals>.barzAssigned implementation)rrrrrr)rrrrrrrr	�test_cant_assign_implementationbs
z-HookableTests.test_cant_assign_implementationcCsZddlm}dd�}||�}y|`Wn&tk
r8Yntk
rJYnX|jd�dS)Nr)rcSsdS)Nrrrrr	rtsz:HookableTests.test_cant_delete_implementation.<locals>.foozDeleted implementation)rrrrrr)rrrrrrr	�test_cant_delete_implementationrsz-HookableTests.test_cant_delete_implementationcsLddlm}g��fdd�}||�}|dddd�|j�d
d	difg�dS)Nr)rcs�j||f�dS)N)�append)�args�kw)�_calledrr	r�sz-HookableTests.test_ctor___call__.<locals>.foo�one�twoZbaz)rr)r"r#)rrZassertEqual)rrrrr)r!r	�test_ctor___call__�sz HookableTests.test_ctor___call__N)�__name__�
__module__�__qualname__r
rrrrrrrrrr$rrrr	rsrcCstjtjt�f�S)N)�unittestZ	TestSuiteZ	makeSuiterrrrr	�
test_suite�sr))�__doc__r(ZTestCaserr)rrrr	�<module>sw