HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/lib/python3/dist-packages/zope/interface/tests/__pycache__/test_registry.cpython-38.pyc
U

ؒ�]%��@s$dZddlZddlmZddlmZddlmZGdd�dej�Z	Gdd	�d	e	�Z
Gd
d�dej�ZGdd
�d
ej�ZGdd�dej�Z
Gdd�dej�ZGdd�de�ZGdd�de�ZGdd�dee�ZGdd�dee�ZGdd�dej�ZGdd�de�ZGdd�de�ZGd d!�d!e�ZdS)"zComponent Registry Tests�N��	Interface)�VerifyingAdapterRegistry��
Componentsc@sfeZdZdd�Zd�dd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�Zd<d=�Z d>d?�Z!d@dA�Z"dBdC�Z#dDdE�Z$dFdG�Z%dHdI�Z&dJdK�Z'dLdM�Z(dNdO�Z)dPdQ�Z*dRdS�Z+dTdU�Z,dVdW�Z-dXdY�Z.dZd[�Z/d\d]�Z0d^d_�Z1d`da�Z2dbdc�Z3ddde�Z4dfdg�Z5dhdi�Z6djdk�Z7dldm�Z8dndo�Z9dpdq�Z:drds�Z;dtdu�Z<dvdw�Z=dxdy�Z>dzd{�Z?d|d}�Z@d~d�ZAd�d��ZBd�d��ZCd�d��ZDd�d��ZEd�d��ZFd�d��ZGd�d��ZHd�d��ZId�d��ZJd�d��ZKd�d��ZLd�d��ZMd�d��ZNd�d��ZOd�d��ZPd�d��ZQd�d��ZRd�d��ZSd�d��ZTd�d��ZUd�d��ZVd�d��ZWd�d��ZXd�d��ZYd�d��ZZd�d��Z[d�d��Z\d�d��Z]d�d��Z^d�d��Z_d�d��Z`d�d��Zad�d��Zbd�dÄZcd�dńZdd�dDŽZed�dɄZfd�d˄Zgd�d̈́Zhd�dτZid�dфZjd�dӄZkd�dՄZld�dׄZmd�S)��ComponentsTestscCstS�Nr��self�r�D/usr/lib/python3/dist-packages/zope/interface/tests/test_registry.py�_getTargetClassszComponentsTests._getTargetClass�testcOs|��|f|�|�Sr�r
)r
�name�args�kwrrr�_makeOneszComponentsTests._makeOnecs0ddlm}g��fdd�}t||d�}|�fS)Nr)�registrycs��||f�dSr��append)rr��_eventsrr�_notify"sz,ComponentsTests._wrapEvents.<locals>._notify)Znotify)�zope.interfacer�_Monkey)r
rr�_monkeyrrr�_wrapEventss
zComponentsTests._wrapEventscCs�ddlm}|�d�}|�|jd�|�|jd�|�t|j|��|�t|j	|��|�|jjd�|�|j	jd�|�|j
i�|�|ji�|�|jg�|�|j
g�dS)Nr)�AdapterRegistry�testingr)�zope.interface.adapterrr�assertEqual�__name__�	__bases__�
assertTrue�
isinstance�adapters�	utilities�_utility_registrations�_adapter_registrations�_subscription_registrations�_handler_registrations)r
r�comprrr�test_ctor_no_bases's
z"ComponentsTests.test_ctor_no_basescCsb|�d�}|�d|f�}|�|jd�|�|j|f�|�|jj|jf�|�|jj|jf�dS)N�baser)rr!r"r#r&r')r
r.r,rrr�test_ctor_w_base5s
z ComponentsTests.test_ctor_w_basecCs|�d�}|�t|�d�dS)Nrz<Components testing>)rr!�repr�r
r,rrr�
test___repr__=s
zComponentsTests.test___repr__cCsl|�d�}|�d�}|��}||f|_|�|j||f�|�|jj|j|jf�|�|jj|j|jf�dS)N�base1�base2)rr#r!r&r')r
r3r4r,rrr�test_assign_to___bases__Cs




�

�z(ComponentsTests.test_assign_to___bases__c	Cs�ddlm}m}Gdd�d|�}|d�}|d�Gdd�dt��}|�}d}|��}|j|||d	�|�|j|df||df�dS)
Nr��named�InterfaceClassc@seZdZdS)zFComponentsTests.test_registerUtility_with_component_name.<locals>.IFooN�r"�
__module__�__qualname__rrrr�IFooRsr<�fooc@seZdZdS)zEComponentsTests.test_registerUtility_with_component_name.<locals>.FooNr9rrrr�FooVsr>�info�r?)�zope.interface.declarationsr7r8�objectr�registerUtilityr!r()	r
r7r8r<�ifoor>r=�_infor,rrr�(test_registerUtility_with_component_nameNs�z8ComponentsTests.test_registerUtility_with_component_namecCs.dd�}t�}|��}|jt|j||d�dS)NcSs
t��dSr��NotImplementedErrorrrrr�_factorycszQComponentsTests.test_registerUtility_both_factory_and_component.<locals>._factory��	component�factory�rBr�assertRaises�	TypeErrorrC�r
rI�_to_regr,rrr�/test_registerUtility_both_factory_and_componentbs
�z?ComponentsTests.test_registerUtility_both_factory_and_componentc	Cs�ddlm}ddlm}ddlm}Gdd�d|�}|d�}d}d}t�}|��}	|��\}
}|
�|	�	||||�W5QRX|�
|	jjd|||k�|�
|	j||f||df�|�
|	jjd|d	|f�|�
t|�d
�|d\}}
|\}|�
|
i�|�
t||��|�
t|j|��|�
|jj|	k�|�
|jj|k�|�
|jj|k�|�
|jj|k�|�
|jj|k�|�
|jjdk�dS)Nr�r8��
Registered��UtilityRegistrationc@seZdZdS)z>ComponentsTests.test_registerUtility_w_component.<locals>.IFooNr9rrrrr<osr<r?r��)rAr8�zope.interface.interfacesrU�zope.interface.registryrWrBrrrCr$r'�	_adaptersr!r(�_subscribers�lenr%r�providedrrKr?rL)r
r8rUrWr<rDrE�_namerQr,rrrr�eventrrr� test_registerUtility_w_componentjs:�z0ComponentsTests.test_registerUtility_w_componentc	sNddlm}ddlm}ddlm}Gdd�d|�}|d�}d}d}t���fd	d
�}|��}	|��\}
}|
�|	j	d||||d�W5QRX|�
t|�d�|d\}}
|\}|�
|
i�|�t
||��|�t
|j|��|�|jj|	k�|�|jj|k�|�|jj|k�|�|jj�k�|�|jj|k�|�|jj|k�dS)
NrrSrTrVc@seZdZdS)z<ComponentsTests.test_registerUtility_w_factory.<locals>.IFooNr9rrrrr<�sr<r?rcs�Srrr�rQrrrI�sz@ComponentsTests.test_registerUtility_w_factory.<locals>._factory�rLrY)rAr8rZrUr[rWrBrrrCr!r^r$r%rr_rrKr?rL)r
r8rUrWr<rDrEr`rIr,rrrrrarrcr�test_registerUtility_w_factory�s2z.ComponentsTests.test_registerUtility_w_factorycCs@Gdd�dt�}d}d}|�}|��}|�t|j|d||�dS)Nc@seZdZdS)zGComponentsTests.test_registerUtility_no_provided_available.<locals>.FooNr9rrrrr>�sr>r?rrM)r
r>rEr`rQr,rrr�*test_registerUtility_no_provided_available�s�z:ComponentsTests.test_registerUtility_no_provided_availablec	Csdddlm}ddlm}ddlm}ddlm}Gdd�d|�}Gdd	�d	t�}|d�}d
}d}	|�}
||
|�|��}|�	�\}}
|�|�
|
d|	|�W5QRX|�t|
�d�|
d\}}|\}|�|i�|�
t||��|�
t|j|��|�
|jj|k�|�
|jj|k�|�
|jj|	k�|�
|jj|
k�|�
|jj|k�|�
|jjdk�dS)
Nr��directlyProvidesrSrTrVc@seZdZdS)z>ComponentsTests.test_registerUtility_wo_provided.<locals>.IFooNr9rrrrr<�sr<c@seZdZdS)z=ComponentsTests.test_registerUtility_wo_provided.<locals>.FooNr9rrrrr>�sr>r?rrY)rArhr8rZrUr[rWrBrrrCr!r^r$r%rr_rrKr?rL)r
rhr8rUrWr<r>rDrEr`rQr,rrrrrarrr� test_registerUtility_wo_provided�s6
z0ComponentsTests.test_registerUtility_wo_providedc
	Cs�ddlm}Gdd�d|�}|d�}d}d}t�}|��}|�||||�|��\}}	|�|�||||�W5QRX|�t|	�d�dS)NrrSc@seZdZdS)zJComponentsTests.test_registerUtility_duplicates_existing_reg.<locals>.IFooNr9rrrrr<�sr<r?r)rAr8rBrrCrr!r^�
r
r8r<rDrEr`rQr,rrrrr�,test_registerUtility_duplicates_existing_reg�sz<ComponentsTests.test_registerUtility_duplicates_existing_regc	Cs�ddlm}Gdd�d|�}|d�}d}d}d}t�}|��}|�||||�|��\}	}
|	�|�||||�W5QRX|�t|
�d�|�|j||f||df�|�|j	j
d|d	|f�dS)
NrrSc@seZdZdS)zCComponentsTests.test_registerUtility_w_different_info.<locals>.IFooNr9rrrrr<�sr<Zinfo1Zinfo2r�rX�rAr8rBrrCrr!r^r(r'r])r
r8r<rDZ_info1Z_info2r`rQr,rrrrr�%test_registerUtility_w_different_info�s&��z5ComponentsTests.test_registerUtility_w_different_infoc	Cs�ddlm}Gdd�d|�}|d�}d}d}d}t�}t�}|��}	|	�||||�|��\}
}|
�|	�||||�W5QRX|�t|�d�|�|	j||f||df�|�|	j||f||df�|�|	j	j
d|d	||f�dS)
NrrSc@seZdZdS)zSComponentsTests.test_registerUtility_w_different_names_same_component.<locals>.IFooNr9rrrrr<�sr<r?�name1�name2rYrXrm�r
r8r<rDrE�_name1�_name2Z
_other_regrQr,rrrrr�5test_registerUtility_w_different_names_same_component�s.���zEComponentsTests.test_registerUtility_w_different_names_same_componentc	Csddlm}ddlm}ddlm}ddlm}Gdd�d|�}|d�}d}d	}t�t�}	}
|��}|�	|	|||�|�
�\}}
|�|�	|
|||�W5QRX|�t|
�d
�|
d\}}|\}|�|i�|�
t||��|�
t|j|��|�
|jj|k�|�
|jj|k�|�
|jj|k�|�
|jj|	k�|�
|jj|k�|�
|jjdk�|
d\}}|\}|�|i�|�
t||��|�
t|j|��|�
|jj|k�|�
|jj|k�|�
|jj|k�|�
|jj|
k�|�
|jj|k�|�
|jjdk�dS)NrrS��UnregisteredrTrVc@seZdZdS)zHComponentsTests.test_registerUtility_replaces_existing_reg.<locals>.IFooNr9rrrrr<sr<r?rrlrY)rAr8rZrvrUr[rWrBrrCrr!r^r$r%rr_rrKr?rL)r
r8rvrUrWr<rDrEr`Z_beforeZ_afterr,rrrrrarrr�*test_registerUtility_replaces_existing_regsJz:ComponentsTests.test_registerUtility_replaces_existing_regc	Cs�ddlm}Gdd�d|�}|d�}d}d}d}t�}|��}|�||||�|��\}	}
|	�|�||||�W5QRX|�|jjd|d|f�dS)	NrrSc@seZdZdS)zDComponentsTests.test_registerUtility_w_existing_subscr.<locals>.IFooNr9rrrrr<<sr<r?rorprX)	rAr8rBrrCrr!r'r]�r
r8r<rDrErrrsrQr,rrrrr�&test_registerUtility_w_existing_subscr9sz6ComponentsTests.test_registerUtility_w_existing_subscrc
	Cs|ddlm}Gdd�d|�}|d�}d}d}t�}|��}|��\}}	|�|�||||d�W5QRX|�t|	�d�dS)NrrSc@seZdZdS)z;ComponentsTests.test_registerUtility_wo_event.<locals>.IFooNr9rrrrr<Msr<r?rF)rAr8rBrrrCr!r^rjrrr�test_registerUtility_wo_eventJsz-ComponentsTests.test_registerUtility_wo_eventcs~G�fdd�d|������}|�t�t�|�tt|����d�Gdd�dt�}|�t�|�|�tt|����d�dS)Ncs"eZdZdZ��fdd�Z�ZS)zdComponentsTests.test_registerUtility_changes_object_identity_after.<locals>.CompThatChangesAfter1Regrcs8|jd7_t�|�j|�|jdkr4t|j�|_dS)NrY)�	reg_count�superrC�dictr(�r
r)�CompThatChangesAfter1Reg�	__class__rrrC^s
ztComponentsTests.test_registerUtility_changes_object_identity_after.<locals>.CompThatChangesAfter1Reg.registerUtility�r"r:r;r{rC�
__classcell__r�r�r�rr\srrYc@seZdZdS)zPComponentsTests.test_registerUtility_changes_object_identity_after.<locals>.IFooNr9rrrrr<isr<rl�r
rCrBrr!r^�list�registeredUtilities)r
r,r<rr�r�2test_registerUtility_changes_object_identity_afterYszBComponentsTests.test_registerUtility_changes_object_identity_aftercs�G�fdd�d|������}|�t�t�|�tt|����d�Gdd�dt�}|�t�|�|�tt|����d�Gdd�dt�}|�t�|�|�tt|����d	�dS)
Ncs"eZdZdZ��fdd�Z�ZS)zeComponentsTests.test_registerUtility_changes_object_identity_before.<locals>.CompThatChangesAfter2Regrcs8|jd7_|jdkr$t|j�|_t�|�j|�dS)NrYrl)r{r}r(r|rCr~)�CompThatChangesAfter2Regr�rrrCts
zuComponentsTests.test_registerUtility_changes_object_identity_before.<locals>.CompThatChangesAfter2Reg.registerUtilityr�r�r�r�rr�rsr�rYc@seZdZdS)zQComponentsTests.test_registerUtility_changes_object_identity_before.<locals>.IFooNr9rrrrr<�sr<rlc@seZdZdS)zQComponentsTests.test_registerUtility_changes_object_identity_before.<locals>.IBarNr9rrrr�IBar�sr��r�)r
r,r<r�rr�r�3test_registerUtility_changes_object_identity_beforeos	zCComponentsTests.test_registerUtility_changes_object_identity_beforecCs"|��}|jt|jdddd�dS)N)rKr_rL)rrNrO�unregisterUtilityr1rrr�Atest_unregisterUtility_neither_factory_nor_component_nor_provided�s
�zQComponentsTests.test_unregisterUtility_neither_factory_nor_component_nor_providedcCs.dd�}t�}|��}|jt|j||d�dS)NcSs
t��dSrrGrrrrrI�szSComponentsTests.test_unregisterUtility_both_factory_and_component.<locals>._factoryrJ)rBrrNrOr�rPrrr�1test_unregisterUtility_both_factory_and_component�s
�zAComponentsTests.test_unregisterUtility_both_factory_and_componentc
	Csxddlm}Gdd�d|�}|d�}d}t�}|��}|��\}}|�|�|||�}	W5QRX|�|	�|�|�dS)NrrSc@seZdZdS)zEComponentsTests.test_unregisterUtility_w_component_miss.<locals>.IFooNr9rrrrr<�sr<r)rAr8rBrrr��assertFalse)
r
r8r<rDr`rQr,rr�unregrrr�'test_unregisterUtility_w_component_miss�s
z7ComponentsTests.test_unregisterUtility_w_component_missc	Csnddlm}ddlm}ddlm}Gdd�d|�}|d�}d}t�}|��}|�|||�|�	�\}	}
|	�|�
|||�}W5QRX|�|�|�|j
j�|�||f|jk�|�|j
j�|�t|
�d�|
d\}}
|\}|�|
i�|�t||��|�t|j|��|�|jj|k�|�|jj|k�|�|jj|k�|�|jj|k�|�|jjdk�dS)	NrrSrurVc@seZdZdS)z@ComponentsTests.test_unregisterUtility_w_component.<locals>.IFooNr9rrrrr<�sr<rrY)rAr8rZrvr[rWrBrrCrr�r$r�r'r\r(r]r!r^r%rr_rrKrL)r
r8rvrWr<rDr`rQr,rrr�rrrarrr�"test_unregisterUtility_w_component�s6
z2ComponentsTests.test_unregisterUtility_w_componentc	sXddlm}ddlm}ddlm}Gdd�d|�}|d�}d}d}t���fd	d
�}|��}	|	jd||||d�|�	�\}
}|
�|	j
d|||d�}W5QRX|�|�|�t
|�d�|d\}
}|
\}|�|i�|�t||��|�t|j|��|�|jj|	k�|�|jj|k�|�|jj|k�|�|jj�k�|�|jj|k�dS)
NrrSrurVc@seZdZdS)z>ComponentsTests.test_unregisterUtility_w_factory.<locals>.IFooNr9rrrrr<�sr<r?rcs�SrrrrcrrrI�szBComponentsTests.test_unregisterUtility_w_factory.<locals>._factoryrdrY)rAr8rZrvr[rWrBrrCrr�r$r!r^r%rr_rrKrL)r
r8rvrWr<rDrEr`rIr,rrr�rrrarrcr� test_unregisterUtility_w_factory�s4
z0ComponentsTests.test_unregisterUtility_w_factoryc	Cs|ddlm}ddlm}ddlm}ddlm}Gdd�d|�}Gdd	�d	t�}|d�}d
}d}	|�}
||
|�|��}|�	|
||	|�|�
�\}}
|�|�|
d|	�}W5QRX|�|�|�
t|
�d�|
d\}}|\}|�
|i�|�t||��|�t|j|��|�|jj|k�|�|jj|k�|�|jj|	k�|�|jj|
k�|�|jj|k�|�|jjdk�dS)
NrrgrSrurVc@seZdZdS)zIComponentsTests.test_unregisterUtility_wo_explicit_provided.<locals>.IFooNr9rrrrr<�sr<c@seZdZdS)zHComponentsTests.test_unregisterUtility_wo_explicit_provided.<locals>.FooNr9rrrrr>�sr>r?rrY�rArhr8rZrvr[rWrBrrCrr�r$r!r^r%rr_rrKr?rL�r
rhr8rvrWr<r>rDrEr`rQr,rrr�rrrarrr�+test_unregisterUtility_wo_explicit_provided�s:

z;ComponentsTests.test_unregisterUtility_wo_explicit_providedc	Cs|ddlm}ddlm}ddlm}ddlm}Gdd�d|�}Gdd	�d	t�}|d�}d
}d}	|�}
||
|�|��}|�	|
||	|�|�
�\}}
|�|j||	d�}W5QRX|�|�|�
t|
�d
�|
d\}}|\}|�
|i�|�t||��|�t|j|��|�|jj|k�|�|jj|k�|�|jj|	k�|�|jj|
k�|�|jj|k�|�|jjdk�dS)NrrgrSrurVc@seZdZdS)zLComponentsTests.test_unregisterUtility_wo_component_or_factory.<locals>.IFooNr9rrrrr<sr<c@seZdZdS)zKComponentsTests.test_unregisterUtility_wo_component_or_factory.<locals>.FooNr9rrrrr>sr>r?r)r_rrYr�r�rrr�.test_unregisterUtility_wo_component_or_factory
s:

z>ComponentsTests.test_unregisterUtility_wo_component_or_factoryc	Cs�ddlm}Gdd�d|�}|d�}d}d}d}t�}|��}|�||||�|�||||�|��\}	}
|	�|�|||�W5QRX|�|jj	d|d|f�dS)	NrrSc@seZdZdS)zFComponentsTests.test_unregisterUtility_w_existing_subscr.<locals>.IFooNr9rrrrr<0sr<r?rorprX�
rAr8rBrrCrr�r!r'r]rxrrr�(test_unregisterUtility_w_existing_subscr-sz8ComponentsTests.test_unregisterUtility_w_existing_subscrc	Cs�ddlm}Gdd�d|�}|d�}d}d}d}t�}|��}|�||||�|�||||�|��\}	}
|	�|�|||�W5QRX|�|jj	d|d|f�dS)	NrrSc@seZdZdS)zSComponentsTests.test_unregisterUtility_w_existing_subscr_non_hashable.<locals>.IFooNr9rrrrr<Bsr<r?rorprX)
rAr8r}rrCrr�r!r'r]rxrrr�5test_unregisterUtility_w_existing_subscr_non_hashable?szEComponentsTests.test_unregisterUtility_w_existing_subscr_non_hashablec	Cs�ddlm}ddlm}Gdd�d|�}|d�}d}d}d}t�}|��}	|	�||||�|	�||||�|��\}
}|
�|	�|||�W5QRX|�	|	j
jd|d	|f�dS)
NrrS)�_UtilityRegistrationsc@seZdZdS)z_ComponentsTests.test_unregisterUtility_w_existing_subscr_non_hashable_fresh_cache.<locals>.IFooNr9rrrrr<Wsr<r?rorprX)rAr8r[r�r}rrCrr�r!r'r])r
r8r�r<rDrErrrsrQr,rrrrr�Atest_unregisterUtility_w_existing_subscr_non_hashable_fresh_cacheQszQComponentsTests.test_unregisterUtility_w_existing_subscr_non_hashable_fresh_cachec	Cs�ddlm}Gdd�d|�}|d�}d}d}d}t�}|��}|�||||�|�||||�|�d�|�||||�|��\}	}
|	�|�|||�W5QRX|�dt	|j
j��dS)	NrrSc@seZdZdS)z]ComponentsTests.test_unregisterUtility_w_existing_subscr_non_hashable_reinitted.<locals>.IFooNr9rrrrr<lsr<r?rorpr.)rAr8r}rrC�__init__rr�r!r^r'r]rxrrr�?test_unregisterUtility_w_existing_subscr_non_hashable_reinittedgs 
zOComponentsTests.test_unregisterUtility_w_existing_subscr_non_hashable_reinittedc	Cs�ddlm}Gdd�d|�}|d�}d}d}d}t�}t�}|��}	|	�||||�|	�||||�|��\}
}|
�|	�|||�W5QRX|�|	jj	d|d|f�dS)	NrrSc@seZdZdS)zVComponentsTests.test_unregisterUtility_w_existing_subscr_other_component.<locals>.IFooNr9rrrrr<�sr<r?rorprXr�rqrrr�8test_unregisterUtility_w_existing_subscr_other_component�s"�zHComponentsTests.test_unregisterUtility_w_existing_subscr_other_componentc	Cs�ddlm}Gdd�d|�}|d�}d}d}d}t�}t�}|��}	|	�||||�|	�||||�|��\}
}|
�|	�|||�W5QRX|�|	j	j
d|d|f�dS)	NrrSc@seZdZdS)zaComponentsTests.test_unregisterUtility_w_existing_subscr_other_component_mixed_hash.<locals>.IFooNr9rrrrr<�sr<r?rorprX)rAr8rBr}rrCrr�r!r'r]rqrrr�Ctest_unregisterUtility_w_existing_subscr_other_component_mixed_hash�s"�zSComponentsTests.test_unregisterUtility_w_existing_subscr_other_component_mixed_hashcCs |��}|�t|���g�dSr)rr!r�r�r1rrr�test_registeredUtilities_empty�sz.ComponentsTests.test_registeredUtilities_emptycCs�ddlm}ddlm}Gdd�d|�}|d�}d}d}d}t�}|��}	|	�||||�|	�||||�t|	��d	d
�d�}
|�	t
|
�d�|�t|
d|��|�|
dj
|	k�|�|
dj|k�|�|
dj|k�|�|
dj|k�|�|
dj|k�|�|
djdk�|�t|
d
|��|�|
d
j
|	k�|�|
d
j|k�|�|
d
j|k�|�|
d
j|k�|�|
d
j|k�|�|
d
jdk�dS)NrrSrVc@seZdZdS)z?ComponentsTests.test_registeredUtilities_notempty.<locals>.IFooNr9rrrrr<�sr<r?rorpcSs|jSr�r��rrrr�<lambda>��zCComponentsTests.test_registeredUtilities_notempty.<locals>.<lambda>��keyrlrY)rAr8r[rWrBrrC�sortedr�r!r^r$r%rr_rrKr?rL)r
r8rWr<rDrErrrsrQr,�regrrr�!test_registeredUtilities_notempty�s6z1ComponentsTests.test_registeredUtilities_notemptycCsDddlm}Gdd�d|�}|d�}|��}|�|�|�dk�dS)NrrSc@seZdZdS)z?ComponentsTests.test_queryUtility_miss_no_default.<locals>.IFooNr9rrrrr<�sr<)rAr8rr$�queryUtility�r
r8r<rDr,rrr�!test_queryUtility_miss_no_default�s
z1ComponentsTests.test_queryUtility_miss_no_defaultcCsNddlm}Gdd�d|�}|d�}|��}t�}|�|j||d�|k�dS)NrrSc@seZdZdS)z>ComponentsTests.test_queryUtility_miss_w_default.<locals>.IFooNr9rrrrr<�sr<��default)rAr8rrBr$r�)r
r8r<rDr,�_defaultrrr� test_queryUtility_miss_w_default�sz0ComponentsTests.test_queryUtility_miss_w_defaultcCsVddlm}Gdd�d|�}|d�}t�}|��}|�||�|�|�|�|k�dS)NrrSc@seZdZdS)z3ComponentsTests.test_queryUtility_hit.<locals>.IFooNr9rrrrr<�sr<)rAr8rBrrCr$r��r
r8r<rDrQr,rrr�test_queryUtility_hit�sz%ComponentsTests.test_queryUtility_hitcCsLddlm}ddlm}Gdd�d|�}|d�}|��}|�||j|�dS)NrrS��ComponentLookupErrorc@seZdZdS)z2ComponentsTests.test_getUtility_miss.<locals>.IFooNr9rrrrr<�sr<)rAr8rZr�rrN�
getUtility)r
r8r�r<rDr,rrr�test_getUtility_miss�sz$ComponentsTests.test_getUtility_misscCsVddlm}Gdd�d|�}|d�}t�}|��}|�||�|�|�|�|k�dS)NrrSc@seZdZdS)z1ComponentsTests.test_getUtility_hit.<locals>.IFooNr9rrrrr<�sr<)rAr8rBrrCr$r�r�rrr�test_getUtility_hit�sz#ComponentsTests.test_getUtility_hitcCsFddlm}Gdd�d|�}|d�}|��}|�t|�|��g�dS)NrrSc@seZdZdS)z7ComponentsTests.test_getUtilitiesFor_miss.<locals>.IFooNr9rrrrr<�sr<)rAr8rr!r��getUtilitiesForr�rrr�test_getUtilitiesFor_miss�s
z)ComponentsTests.test_getUtilitiesFor_misscCs�ddlm}Gdd�d|�}|d�}d}d}t�}|��}|j|||d�|j|||d�|�t|�|��||f||fg�dS)NrrSc@seZdZdS)z6ComponentsTests.test_getUtilitiesFor_hit.<locals>.IFooNr9rrrrr<sr<rorpr�)rAr8rBrrCr!r�r��r
r8r<rDrrrsrQr,rrr�test_getUtilitiesFor_hits�z(ComponentsTests.test_getUtilitiesFor_hitcCsFddlm}Gdd�d|�}|d�}|��}|�t|�|��g�dS)NrrSc@seZdZdS)zDComponentsTests.test_getAllUtilitiesRegisteredFor_miss.<locals>.IFooNr9rrrrr<sr<)rAr8rr!r��getAllUtilitiesRegisteredForr�rrr�&test_getAllUtilitiesRegisteredFor_misss
z6ComponentsTests.test_getAllUtilitiesRegisteredFor_misscCsvddlm}Gdd�d|�}|d�}d}d}t�}|��}|j|||d�|j|||d�|�t|�|��|g�dS)NrrSc@seZdZdS)zCComponentsTests.test_getAllUtilitiesRegisteredFor_hit.<locals>.IFooNr9rrrrr<sr<rorpr�)rAr8rBrrCr!r�r�r�rrr�%test_getAllUtilitiesRegisteredFor_hits�z5ComponentsTests.test_getAllUtilitiesRegisteredFor_hitc	Cs�ddlm}m}Gdd�d|�}|d�}|d�}|d�Gdd�dt��}d	}|��}|j||f||d
�|�|j|f|df||f�dS)Nrr6c@seZdZdS)zFComponentsTests.test_registerAdapter_with_component_name.<locals>.IFooNr9rrrrr</sr<r�r=c@seZdZdS)zEComponentsTests.test_registerAdapter_with_component_name.<locals>.FooNr9rrrrr>4sr>r?r@)rAr7r8rBr�registerAdapterr!r))	r
r7r8r<rD�ibarr>rEr,rrr�(test_registerAdapter_with_component_name+s�z8ComponentsTests.test_registerAdapter_with_component_namec	Cs�ddlm}ddlm}ddlm}Gdd�d|�}|d�}|d�}d}d	}d
d�}	|��}
|��\}}|�|
�|	|f|||�W5QRX|�	|
j
jd||||	k�|�|
j
|f||f|	|f�|�t|�d�|d\}
}|
\}|�|i�|�	t||��|�	t|j|��|�	|jj|
k�|�	|jj|k�|�|jj|f�|�	|jj|k�|�	|jj|k�|�	|jj|	k�dS)
NrrSrT��AdapterRegistrationc@seZdZdS)zSComponentsTests.test_registerAdapter_w_explicit_provided_and_required.<locals>.IFooNr9rrrrr<Esr<r�r?rcSs
t��dSrrG��contextrrrrILszWComponentsTests.test_registerAdapter_w_explicit_provided_and_required.<locals>._factoryrY)rAr8rZrUr[r�rrr�r$r&r\r!r)r^r%rBrr_�requiredrr?rL)r
r8rUr�r<rDr�rEr`rIr,rrrrrarrr�5test_registerAdapter_w_explicit_provided_and_required@s>��zEComponentsTests.test_registerAdapter_w_explicit_provided_and_requiredc	Cshddlm}Gdd�d|�}|d�}d}d}t�}Gdd	�d	t�}|��}|jt|j||f||d
�dS)NrrSc@seZdZdS)zHComponentsTests.test_registerAdapter_no_provided_available.<locals>.IFooNr9rrrrr<fsr<r�r?rc@seZdZdS)zLComponentsTests.test_registerAdapter_no_provided_available.<locals>._FactoryNr9rrrr�_Factorymsr��rr?�rAr8rBrrNrOr�)	r
r8r<r�rEr`rQr�r,rrr�*test_registerAdapter_no_provided_availablecs�z:ComponentsTests.test_registerAdapter_no_provided_availablec	Cs�ddlm}ddlm}ddlm}ddlm}Gdd�d|�}|d�}|d�}d	}d
}	t�}
||�Gdd�dt��}|��}|�	�\}
}|
�|j
||f|	|d
�W5QRX|�|jj
d|||	|k�|�|j|f||	f||f�|�t|�d�|d\}}|\}|�|i�|�t||��|�t|j|��|�|jj|k�|�|jj|k�|�|jj|f�|�|jj|	k�|�|jj|k�|�|jj|k�dS)NrrS��implementerrTr�c@seZdZdS)zGComponentsTests.test_registerAdapter_wo_explicit_provided.<locals>.IFooNr9rrrrr<zsr<r�r?rc@seZdZdS)zKComponentsTests.test_registerAdapter_wo_explicit_provided.<locals>._FactoryNr9rrrrr��sr�r�rY)rAr8r�rZrUr[r�rBrrr�r$r&r\r!r)r^r%rr_r�rr?rL)r
r8r�rUr�r<rDr�rEr`rQr�r,rrrrrarrr�)test_registerAdapter_wo_explicit_providedtsD��z9ComponentsTests.test_registerAdapter_wo_explicit_providedcCs`ddlm}Gdd�d|�}|d�}d}d}Gdd�dt�}|��}|jt|j||||d	�dS)
NrrSc@seZdZdS)zHComponentsTests.test_registerAdapter_no_required_available.<locals>.IFooNr9rrrrr<�sr<r?rc@seZdZdS)zLComponentsTests.test_registerAdapter_no_required_available.<locals>._FactoryNr9rrrrr��sr��r_rr?r��r
r8r<rDrEr`r�r,rrr�*test_registerAdapter_no_required_available�s�z:ComponentsTests.test_registerAdapter_no_required_availablec		Csjddlm}Gdd�d|�}|d�}|d�}d}d}Gdd	�d	t�}|��}|jt|j|||||d
�dS)NrrSc@seZdZdS)zEComponentsTests.test_registerAdapter_w_invalid_required.<locals>.IFooNr9rrrrr<�sr<r�r?rc@seZdZdS)zIComponentsTests.test_registerAdapter_w_invalid_required.<locals>._FactoryNr9rrrrr��sr�r�r�)	r
r8r<rDr�rEr`r�r,rrr�'test_registerAdapter_w_invalid_required�s�z7ComponentsTests.test_registerAdapter_w_invalid_requiredc	Cs�ddlm}ddlm}ddlm}ddlm}Gdd�d|�}|d�}d}d	}Gd
d�dt�}	|�	�}
|�
�\}}|�|
j|	dg|||d�W5QRX|�|
j
jd
||||	k�|�|
j|f||f|	|f�|�t|�d
�|d\}
}|
\}|�|i�|�t||��|�t|j|��|�|jj|
k�|�|jj|k�|�|jj|f�|�|jj|k�|�|jj|k�|�|jj|	k�dS)NrrSrrTr�c@seZdZdS)zMComponentsTests.test_registerAdapter_w_required_containing_None.<locals>.IFooNr9rrrrr<�sr<r?rc@seZdZdS)zQComponentsTests.test_registerAdapter_w_required_containing_None.<locals>._FactoryNr9rrrrr��sr�r�rY)rAr8Zzope.interface.interfacerrZrUr[r�rBrrr�r$r&r\r!r)r^r%rr_r�rr?rL)r
r8rrUr�r<rDrEr`r�r,rrrrrarrr�/test_registerAdapter_w_required_containing_None�sD���z?ComponentsTests.test_registerAdapter_w_required_containing_Nonec	Cs�ddlm}ddlm}ddlm}ddlm}ddlm}Gdd�d|�}|d�}|d	�}d
}	d}
Gdd
�d
t�}||�Gdd�dt��}||�}
|�	�}|�
�\}}|�|j||g||
|	d�W5QRX|�|j
jd|
||
|k�|�|j|
f||
f||	f�|�t|�d�|d\}}|\}|�|i�|�t||��|�t|j|��|�|jj|k�|�|jj|k�|�|jj|
f�|�|jj|
k�|�|jj|	k�|�|jj|k�dS)NrrSr�)�
implementedByrTr�c@seZdZdS)zNComponentsTests.test_registerAdapter_w_required_containing_class.<locals>.IFooNr9rrrrr<�sr<r�r?rc@seZdZdS)zRComponentsTests.test_registerAdapter_w_required_containing_class.<locals>._FactoryNr9rrrrr��sr�c@seZdZdS)zRComponentsTests.test_registerAdapter_w_required_containing_class.<locals>._ContextNr9rrrr�_Context�sr�r�rY)rAr8r�r�rZrUr[r�rBrrr�r$r&r\r!r)r^r%rr_r�rr?rL)r
r8r�r�rUr�r<rDr�rEr`r�r�Z	_ctx_implr,rrrrrarrr�0test_registerAdapter_w_required_containing_class�sN���z@ComponentsTests.test_registerAdapter_w_required_containing_classc	Csfddlm}Gdd�d|�}|d�}d}d}Gdd�dt�}|��}|jt|j|t�g|||d	�dS)
NrrSc@seZdZdS)zMComponentsTests.test_registerAdapter_w_required_containing_junk.<locals>.IFooNr9rrrrr<
sr<r?rc@seZdZdS)zQComponentsTests.test_registerAdapter_w_required_containing_junk.<locals>._FactoryNr9rrrrr�sr�r�r�r�rrr�/test_registerAdapter_w_required_containing_junks�z?ComponentsTests.test_registerAdapter_w_required_containing_junkc	s�ddlm}ddlm}ddlm}Gdd�d|�}|d�}|d��d}d	}G�fd
d�dt�}|��}	|��\}
}|
�|	j	||||d�W5QRX|�
|	jjd
�|||k�|�
|	j�f||f||f�|�
t|�d
�|d\}}
|\}|�
|
i�|�
t||��|�
t|j|��|�
|jj|	k�|�
|jj|k�|�
|jj�f�|�
|jj|k�|�
|jj|k�|�
|jj|k�dS)NrrSrTr�c@seZdZdS)zGComponentsTests.test_registerAdapter_wo_explicit_required.<locals>.IFooNr9rrrrr<sr<r�r?rcseZdZ�fZdS)zKComponentsTests.test_registerAdapter_wo_explicit_required.<locals>._FactoryN�r"r:r;�__component_adapts__r�r�rrr�!sr�r�rY)rAr8rZrUr[r�rBrrr�r$r&r\r!r)r^r%rr_r�rr?rL)r
r8rUr�r<rDrEr`r�r,rrrrrarr�r�)test_registerAdapter_wo_explicit_requiredsB
���z9ComponentsTests.test_registerAdapter_wo_explicit_requiredc	Cs�ddlm}Gdd�d|�}|d�}|d�}d}d}dd	�}|��}|��\}	}
|	�|j||f|||d
d�W5QRX|�t|
�d�dS)NrrSc@seZdZdS)z;ComponentsTests.test_registerAdapter_wo_event.<locals>.IFooNr9rrrrr<=sr<r�r?rcSs
t��dSrrGr�rrrrIDsz?ComponentsTests.test_registerAdapter_wo_event.<locals>._factoryF)ra)rAr8rrr�r!r^)r
r8r<rDr�rEr`rIr,rrrrr�test_registerAdapter_wo_event:s�z-ComponentsTests.test_registerAdapter_wo_eventcCs |��}|jt|jddd�dS�N)rLr_)rrNrO�unregisterAdapterr1rrr�3test_unregisterAdapter_neither_factory_nor_providedMs

�zCComponentsTests.test_unregisterAdapter_neither_factory_nor_providedcCsFddlm}Gdd�d|�}|d�}|��}|jt|jd|dd�dS)NrrSc@seZdZdS)zQComponentsTests.test_unregisterAdapter_neither_factory_nor_required.<locals>.IFooNr9rrrrr<Tsr<�rLr_r�)rAr8rrNrOr�r�rrr�3test_unregisterAdapter_neither_factory_nor_requiredRs
�zCComponentsTests.test_unregisterAdapter_neither_factory_nor_requiredc
	Cs~ddlm}Gdd�d|�}|d�}|d�}Gdd�dt�}|��}|��\}}|�|�||f|�}	W5QRX|�|	�dS)NrrSc@seZdZdS)z9ComponentsTests.test_unregisterAdapter_miss.<locals>.IFooNr9rrrrr<]sr<r�c@seZdZdS)z=ComponentsTests.test_unregisterAdapter_miss.<locals>._FactoryNr9rrrrr�asr�)rAr8rBrrr�r��
r
r8r<rDr�r�r,rrr�rrr�test_unregisterAdapter_miss[sz+ComponentsTests.test_unregisterAdapter_missc	Csxddlm}ddlm}ddlm}Gdd�d|�}|d�}|d�}Gdd	�d	t�}|��}|�||f|�|�	�\}	}
|	�|�
||f|�}W5QRX|�|�|�|j
j�|�|j�|�t|
�d
�|
d\}}
|\}|�|
i�|�t||��|�t|j|��|�|jj|k�|�|jj|k�|�|jj|f�|�|jjd�|�|jjd�|�|jj|k�dS)NrrSrur�c@seZdZdS)zYComponentsTests.test_unregisterAdapter_hit_w_explicit_provided_and_required.<locals>.IFooNr9rrrrr<nsr<r�c@seZdZdS)z]ComponentsTests.test_unregisterAdapter_hit_w_explicit_provided_and_required.<locals>._FactoryNr9rrrrr�rsr�rYrX)rAr8rZrvr[r�rBrr�rr�r$r�r&r\r)r!r^r%rr_r�rr?rL)r
r8rvr�r<rDr�r�r,rrr�rrrarrr�;test_unregisterAdapter_hit_w_explicit_provided_and_requiredjs6
zKComponentsTests.test_unregisterAdapter_hit_w_explicit_provided_and_requiredc	Cspddlm}ddlm}ddlm}ddlm}Gdd�d|�}|d�}|d�}||�Gd	d
�d
t��}|��}	|	�	||f|�|�
�\}
}|
�|	�||f�}W5QRX|�|�|�
t|�d�|d\}
}|
\}|�
|i�|�t||��|�t|j|��|�|jj|	k�|�|jj|k�|�
|jj|f�|�
|jjd�|�
|jjd�|�|jj|k�dS)
NrrSr�rur�c@seZdZdS)zIComponentsTests.test_unregisterAdapter_wo_explicit_provided.<locals>.IFooNr9rrrrr<�sr<r�c@seZdZdS)zMComponentsTests.test_unregisterAdapter_wo_explicit_provided.<locals>._FactoryNr9rrrrr��sr�rYrX)rAr8r�rZrvr[r�rBrr�rr�r$r!r^r%rr_r�rr?rL)r
r8r�rvr�r<rDr�r�r,rrr�rrrarrr�+test_unregisterAdapter_wo_explicit_provided�s6
z;ComponentsTests.test_unregisterAdapter_wo_explicit_providedc	s`ddlm}ddlm}ddlm}Gdd�d|�}|d�}|d��G�fdd	�d	t�}|��}|�|�f|�|�	�\}}	|�|j
||d
�}
W5QRX|�|
�|�t
|	�d�|	d\}}|\}
|�|i�|�t|
|��|�t|
j|��|�|
jj|k�|�|
jj|k�|�|
jj�f�|�|
jjd�|�|
jjd�|�|
jj|k�dS)
NrrSrur�c@seZdZdS)zIComponentsTests.test_unregisterAdapter_wo_explicit_required.<locals>.IFooNr9rrrrr<�sr<r�cseZdZ�fZdS)zMComponentsTests.test_unregisterAdapter_wo_explicit_required.<locals>._FactoryNr�rr�rrr��sr��r_rYrX)rAr8rZrvr[r�rBrr�rr�r$r!r^r%rr_r�rr?rL)r
r8rvr�r<rDr�r,rrr�rrrarr�r�+test_unregisterAdapter_wo_explicit_required�s2
z;ComponentsTests.test_unregisterAdapter_wo_explicit_requiredcCs |��}|�t|���g�dSr)rr!r��registeredAdaptersr1rrr�test_registeredAdapters_empty�sz-ComponentsTests.test_registeredAdapters_emptycCs�ddlm}ddlm}Gdd�d|�}|d�}|d�}d}d}d}Gd	d
�d
t�}	|��}
|
�|	|f|||�|
�|	|f|||�t|
��dd�d
�}|�	t
|�d�|�t|d|��|�|dj
|
k�|�|dj|k�|�	|dj|f�|�|dj|k�|�|dj|k�|�|dj|	k�|�t|d|��|�|dj
|
k�|�|dj|k�|�	|dj|f�|�|dj|k�|�|dj|k�|�|dj|	k�dS)NrrSr�c@seZdZdS)z>ComponentsTests.test_registeredAdapters_notempty.<locals>.IFooNr9rrrrr<�sr<r?rorpc@seZdZdS)zBComponentsTests.test_registeredAdapters_notempty.<locals>._FactoryNr9rrrrr��sr�cSs|jSrr�r�rrrr��r�zBComponentsTests.test_registeredAdapters_notempty.<locals>.<lambda>r�rlrY)rAr8r[r�rBrr�r�r�r!r^r$r%rr_r�rr?rL)r
r8r�r<rDr�rErrrsr�r,r�rrr� test_registeredAdapters_notempty�s8z0ComponentsTests.test_registeredAdapters_notemptycCsLddlm}Gdd�d|�}|d�}|��}t�}|�|�||�dk�dS)NrrSc@seZdZdS)z?ComponentsTests.test_queryAdapter_miss_no_default.<locals>.IFooNr9rrrrr<�sr<�rAr8rrBr$�queryAdapter)r
r8r<rDr,�_contextrrr�!test_queryAdapter_miss_no_default�sz1ComponentsTests.test_queryAdapter_miss_no_defaultcCsVddlm}Gdd�d|�}|d�}|��}t�}t�}|�|j|||d�|k�dS)NrrSc@seZdZdS)z>ComponentsTests.test_queryAdapter_miss_w_default.<locals>.IFooNr9rrrrr<�sr<r�r�)r
r8r<rDr,r�r�rrr� test_queryAdapter_miss_w_default�s�z0ComponentsTests.test_queryAdapter_miss_w_defaultcCs�ddlm}ddlm}Gdd�d|�}|d�}|d�}Gdd�dt�}||�Gd	d
�d
t��}|�}|��}	|	�||f|�|	�||�}
|�t|
|��|�|
j	|k�dS)NrrSr�c@seZdZdS)z3ComponentsTests.test_queryAdapter_hit.<locals>.IFooNr9rrrrr<sr<r�c@seZdZdd�ZdS)z7ComponentsTests.test_queryAdapter_hit.<locals>._FactorycSs
||_dSrr��r
r�rrrr�
sz@ComponentsTests.test_queryAdapter_hit.<locals>._Factory.__init__N�r"r:r;r�rrrrr�	sr�c@seZdZdS)z7ComponentsTests.test_queryAdapter_hit.<locals>._ContextNr9rrrrr�sr�)
rAr8r�rBrr�r�r$r%r��r
r8r�r<rDr�r�r�r�r,�adapterrrr�test_queryAdapter_hitsz%ComponentsTests.test_queryAdapter_hitc
Cs�ddlm}ddlm}ddlm}Gdd�d|�}|d�}|d�}||�Gdd	�d	t��}|�}|��}	|�||	j||�dS)
NrrSr�r�c@seZdZdS)z2ComponentsTests.test_getAdapter_miss.<locals>.IFooNr9rrrrr<sr<r�c@seZdZdS)z6ComponentsTests.test_getAdapter_miss.<locals>._ContextNr9rrrrr�sr�)	rAr8r�rZr�rBrrN�
getAdapter)
r
r8r�r�r<rDr�r�r�r,rrr�test_getAdapter_misss�z$ComponentsTests.test_getAdapter_misscCs�ddlm}ddlm}Gdd�d|�}|d�}|d�}Gdd�dt�}||�Gd	d
�d
t��}|�}|��}	|	�||f|�|	�||�}
|�t|
|��|�|
j	|k�dS)NrrSr�c@seZdZdS)z1ComponentsTests.test_getAdapter_hit.<locals>.IFooNr9rrrrr<)sr<r�c@seZdZdd�ZdS)z5ComponentsTests.test_getAdapter_hit.<locals>._FactorycSs
||_dSrr�r�rrrr�.sz>ComponentsTests.test_getAdapter_hit.<locals>._Factory.__init__Nr�rrrrr�-sr�c@seZdZdS)z5ComponentsTests.test_getAdapter_hit.<locals>._ContextNr9rrrrr�0sr�)
rAr8r�rBrr�r�r$r%r�r�rrr�test_getAdapter_hit&sz#ComponentsTests.test_getAdapter_hitcCs�ddlm}ddlm}Gdd�d|�}|d�}|d�}|d�}||�Gdd	�d	t��}||�Gd
d�dt��}|�}	|�}
|��}|�|�|	|
f|�d�dS)NrrSr�c@seZdZdS)z9ComponentsTests.test_queryMultiAdapter_miss.<locals>.IFooNr9rrrrr<=sr<r��IBazc@seZdZdS)z>ComponentsTests.test_queryMultiAdapter_miss.<locals>._Context1Nr9rrrr�	_Context1Bsr�c@seZdZdS)z>ComponentsTests.test_queryMultiAdapter_miss.<locals>._Context2Nr9rrrr�	_Context2Esr�)rAr8r�rBrr!�queryMultiAdapter�r
r8r�r<rDr��ibazr�r��	_context1�	_context2r,rrr�test_queryMultiAdapter_miss:s �z+ComponentsTests.test_queryMultiAdapter_missc
Cs�ddlm}ddlm}Gdd�d|�}|d�}|d�}|d�}||�Gdd	�d	t��}||�Gd
d�dt��}|�}	|�}
t�}|��}|�|j|	|
f||d�|k�dS)
NrrSr�c@seZdZdS)zCComponentsTests.test_queryMultiAdapter_miss_w_default.<locals>.IFooNr9rrrrr<Qsr<r�r�c@seZdZdS)zHComponentsTests.test_queryMultiAdapter_miss_w_default.<locals>._Context1Nr9rrrrr�Vsr�c@seZdZdS)zHComponentsTests.test_queryMultiAdapter_miss_w_default.<locals>._Context2Nr9rrrrr�Ysr�r�)rAr8r�rBrr$r�)
r
r8r�r<rDr�rr�r�rrr�r,rrr�%test_queryMultiAdapter_miss_w_defaultNs*���z5ComponentsTests.test_queryMultiAdapter_miss_w_defaultcCs�ddlm}ddlm}Gdd�d|�}|d�}|d�}|d�}||�Gdd	�d	t��}||�Gd
d�dt��}|�}	|�}
Gdd
�d
t�}|��}|�|||f|�|�|	|
f|�}
|�t|
|��|�	|
j
|	|
f�dS)NrrSr�c@seZdZdS)z8ComponentsTests.test_queryMultiAdapter_hit.<locals>.IFooNr9rrrrr<gsr<r�r�c@seZdZdS)z=ComponentsTests.test_queryMultiAdapter_hit.<locals>._Context1Nr9rrrrr�lsr�c@seZdZdS)z=ComponentsTests.test_queryMultiAdapter_hit.<locals>._Context2Nr9rrrrr�osr�c@seZdZdd�ZdS)z<ComponentsTests.test_queryMultiAdapter_hit.<locals>._FactorycSs||f|_dSrr��r
�context1�context2rrrr�uszEComponentsTests.test_queryMultiAdapter_hit.<locals>._Factory.__init__Nr�rrrrr�tsr�)rAr8r�rBrr�r�r$r%r!r��r
r8r�r<rDr�rr�r�rrr�r,r�rrr�test_queryMultiAdapter_hitds$z*ComponentsTests.test_queryMultiAdapter_hitc
Cs�ddlm}ddlm}ddlm}Gdd�d|�}|d�}|d�}|d�}||�Gd	d
�d
t��}||�Gdd�dt��}	|�}
|	�}|��}|�||j|
|f|�dS)
NrrSr�r�c@seZdZdS)z7ComponentsTests.test_getMultiAdapter_miss.<locals>.IFooNr9rrrrr<�sr<r�r�c@seZdZdS)z<ComponentsTests.test_getMultiAdapter_miss.<locals>._Context1Nr9rrrrr��sr�c@seZdZdS)z<ComponentsTests.test_getMultiAdapter_miss.<locals>._Context2Nr9rrrrr��sr�)	rAr8r�rZr�rBrrN�getMultiAdapter)
r
r8r�r�r<rDr�rr�r�rrr,rrr�test_getMultiAdapter_miss}s&�z)ComponentsTests.test_getMultiAdapter_misscCs�ddlm}ddlm}Gdd�d|�}|d�}|d�}|d�}||�Gdd	�d	t��}||�Gd
d�dt��}|�}	|�}
Gdd
�d
t�}|��}|�|||f|�|�|	|
f|�}
|�t|
|��|�	|
j
|	|
f�dS)NrrSr�c@seZdZdS)z6ComponentsTests.test_getMultiAdapter_hit.<locals>.IFooNr9rrrrr<�sr<r�r�c@seZdZdS)z;ComponentsTests.test_getMultiAdapter_hit.<locals>._Context1Nr9rrrrr��sr�c@seZdZdS)z;ComponentsTests.test_getMultiAdapter_hit.<locals>._Context2Nr9rrrrr��sr�c@seZdZdd�ZdS)z:ComponentsTests.test_getMultiAdapter_hit.<locals>._FactorycSs||f|_dSrr�rrrrr��szCComponentsTests.test_getMultiAdapter_hit.<locals>._Factory.__init__Nr�rrrrr��sr�)rAr8r�rBrr�rr$r%r!r�r	rrr�test_getMultiAdapter_hit�s$z(ComponentsTests.test_getMultiAdapter_hitcCs�ddlm}ddlm}Gdd�d|�}|d�}|d�}|d�}||�Gdd	�d	t��}||�Gd
d�dt��}|�}	|�}
|��}|�t|�|	|
f|��g�dS)NrrSr�c@seZdZdS)z4ComponentsTests.test_getAdapters_empty.<locals>.IFooNr9rrrrr<�sr<r�r�c@seZdZdS)z9ComponentsTests.test_getAdapters_empty.<locals>._Context1Nr9rrrrr��sr�c@seZdZdS)z9ComponentsTests.test_getAdapters_empty.<locals>._Context2Nr9rrrrr��sr�)rAr8r�rBrr!r��getAdaptersrrrr�test_getAdapters_empty�s"�z&ComponentsTests.test_getAdapters_emptyc
s�ddlm}ddlm}Gdd�d|�}|d�}|d�}|d�}||�Gdd	�d	t��}||�Gd
d�dt��}|�}	|�}
|��}g��fdd
�}|�|||f|�|�t|�|	|
f|��g�|��|	|
fg�dS)NrrSr�c@seZdZdS)zCComponentsTests.test_getAdapters_factory_returns_None.<locals>.IFooNr9rrrrr<�sr<r�r�c@seZdZdS)zHComponentsTests.test_getAdapters_factory_returns_None.<locals>._Context1Nr9rrrrr��sr�c@seZdZdS)zHComponentsTests.test_getAdapters_factory_returns_None.<locals>._Context2Nr9rrrrr��sr�cs��||f�dSrr)rr�Z_called_withrr�_side_effect_only�szPComponentsTests.test_getAdapters_factory_returns_None.<locals>._side_effect_only)	rAr8r�rBrr�r!r�r)
r
r8r�r<rDr�rr�r�rrr,rrrr�%test_getAdapters_factory_returns_None�s*�z5ComponentsTests.test_getAdapters_factory_returns_NonecCsXddlm}ddlm}Gdd�d|�}|d�}|d�}|d�}||�Gdd	�d	t��}||�Gd
d�dt��}|�}	|�}
Gdd
�d
t�}Gdd�dt�}d}
d}|��}|j|||f||
d�|j|||f||d�t|�|	|
f|��}|�t	|�d�|�|dd|
�|�
t|dd|��|�|dd|�|�
t|dd|��dS)NrrSr�c@seZdZdS)z8ComponentsTests.test_getAdapters_non_empty.<locals>.IFooNr9rrrrr<�sr<r�r�c@seZdZdS)z=ComponentsTests.test_getAdapters_non_empty.<locals>._Context1Nr9rrrrr��sr�c@seZdZdS)z=ComponentsTests.test_getAdapters_non_empty.<locals>._Context2Nr9rrrrr��sr�c@seZdZdd�ZdS)z=ComponentsTests.test_getAdapters_non_empty.<locals>._Factory1cSs||f|_dSrr�rrrrr��szFComponentsTests.test_getAdapters_non_empty.<locals>._Factory1.__init__Nr�rrrr�	_Factory1�src@seZdZdd�ZdS)z=ComponentsTests.test_getAdapters_non_empty.<locals>._Factory2cSs||f|_dSrr�rrrrr��szFComponentsTests.test_getAdapters_non_empty.<locals>._Factory2.__init__Nr�rrrr�	_Factory2�srrorpr�rlrY)rAr8r�rBrr�r�rr!r^r$r%)r
r8r�r<rDr�rr�r�rrrrrrrsr,�foundrrr�test_getAdapters_non_empty�s2z*ComponentsTests.test_getAdapters_non_emptyc		Csbddlm}Gdd�d|�}|d�}|d�}d}d}dd	�}|��}|�t|j||f|||�dS)
NrrSc@seZdZdS)zNComponentsTests.test_registerSubscriptionAdapter_w_nonblank_name.<locals>.IFooNr9rrrrr<�sr<r�rr?cSs
t��dSrrGr�rrrrIszRComponentsTests.test_registerSubscriptionAdapter_w_nonblank_name.<locals>._factory)rAr8rrNrO�registerSubscriptionAdapter)	r
r8r<rDr�r`rErIr,rrr�0test_registerSubscriptionAdapter_w_nonblank_name�s
�z@ComponentsTests.test_registerSubscriptionAdapter_w_nonblank_namec	Cs�ddlm}ddlm}ddlm}Gdd�d|�}|d�}|d�}d}d	}d
d�}	|��}
|��\}}|�|
j|	|f||d�W5QRX|
j	j
d
|||}
|�t|
�d
�|�
|
d|	k�|�|
j|f|||	|fg�|�t|�d
�|d\}}|\}|�|i�|�
t||��|�
t|j|��|�
|jj|
k�|�
|jj|k�|�|jj|f�|�|jj|�|�
|jj|k�|�
|jj|	k�dS)NrrSrT��SubscriptionRegistrationc@seZdZdS)z_ComponentsTests.test_registerSubscriptionAdapter_w_explicit_provided_and_required.<locals>.IFooNr9rrrrr<sr<r�rXr?cSs
t��dSrrGr�rrrrIszcComponentsTests.test_registerSubscriptionAdapter_w_explicit_provided_and_required.<locals>._factoryr@rY)rAr8rZrUr[rrrrr&r]r!r^r$r*r%rBrr_r�rr?rL)r
r8rUrr<rDr��_blankrErIr,rrr�rrrarrr�Atest_registerSubscriptionAdapter_w_explicit_provided_and_requiredsB��zQComponentsTests.test_registerSubscriptionAdapter_w_explicit_provided_and_requiredc	Cs�ddlm}ddlm}ddlm}ddlm}Gdd�d|�}|d�}|d�}d	}d
}	||�Gdd�dt��}
|��}|�	�\}}
|�|j
|
|f|d
�W5QRX|jjd|||	}|�
t|�d�|�|d|
k�|�
|j|f||	|
|fg�|�
t|
�d�|
d\}}|\}|�
|i�|�t||��|�t|j|��|�|jj|k�|�|jj|k�|�
|jj|f�|�
|jj|	�|�|jj|k�|�|jj|
k�dS)NrrSr�rTrc@seZdZdS)zSComponentsTests.test_registerSubscriptionAdapter_wo_explicit_provided.<locals>.IFooNr9rrrrr<6sr<r�r?rXc@seZdZdS)zWComponentsTests.test_registerSubscriptionAdapter_wo_explicit_provided.<locals>._FactoryNr9rrrrr�=sr�r@rY)rAr8r�rZrUr[rrBrrrr&r]r!r^r$r*r%rr_r�rr?rL)r
r8r�rUrr<rDr�rErr�r,rrr�rrrarrr�5test_registerSubscriptionAdapter_wo_explicit_provided0sB�zEComponentsTests.test_registerSubscriptionAdapter_wo_explicit_providedc	s�ddlm}ddlm}ddlm}Gdd�d|�}|d�}|d��d}d	}G�fd
d�dt�}|��}	|��\}
}|
�|	j	|||d�W5QRX|	j
jd
�||}|�t
|�d
�|�|d|k�|�|	j�f||||fg�|�t
|�d
�|d\}
}|
\}|�|i�|�t||��|�t|j|��|�|jj|	k�|�|jj|k�|�|jj�f�|�|jj|�|�|jj|k�|�|jj|k�dS)NrrSrTrc@seZdZdS)zSComponentsTests.test_registerSubscriptionAdapter_wo_explicit_required.<locals>.IFooNr9rrrrr<\sr<r�r?rXcseZdZ�fZdS)zWComponentsTests.test_registerSubscriptionAdapter_wo_explicit_required.<locals>._FactoryNr�rr�rrr�bsr�)r_r?rY)rAr8rZrUr[rrBrrrr&r]r!r^r$r*r%rr_r�rr?rL)r
r8rUrr<rDrErr�r,rrr�rrrarr�r�5test_registerSubscriptionAdapter_wo_explicit_requiredWsF��zEComponentsTests.test_registerSubscriptionAdapter_wo_explicit_requiredc	Cs�ddlm}Gdd�d|�}|d�}|d�}d}d}dd	�}|��}|��\}	}
|	�|j||f||d
d�W5QRX|�t|
�d�dS)NrrSc@seZdZdS)zGComponentsTests.test_registerSubscriptionAdapter_wo_event.<locals>.IFooNr9rrrrr<sr<r�rXr?cSs
t��dSrrGr�rrrrI�szKComponentsTests.test_registerSubscriptionAdapter_wo_event.<locals>._factoryF�r?ra)rAr8rrrr!r^)r
r8r<rDr�rrErIr,rrrrr�)test_registerSubscriptionAdapter_wo_event|s�z9ComponentsTests.test_registerSubscriptionAdapter_wo_eventcCs |��}|�t|���g�dSr)rr!r��registeredSubscriptionAdaptersr1rrr�)test_registeredSubscriptionAdapters_empty�sz9ComponentsTests.test_registeredSubscriptionAdapters_emptycCs�ddlm}ddlm}Gdd�d|�}|d�}|d�}d}d}Gdd	�d	t�}|��}	|	j||f||d
�|	j||f||d
�t|	���}
|�	t
|
�d�|�t|
d|��|�|
dj
|	k�|�|
dj|k�|�	|
dj|f�|�	|
dj|�|�|
dj|k�|�|
dj|k�|�t|
d|��|�|
dj
|	k�|�|
dj|k�|�	|
dj|f�|�	|
dj|�|�|
dj|k�|�|
dj|k�dS)
NrrSrc@seZdZdS)zJComponentsTests.test_registeredSubscriptionAdapters_notempty.<locals>.IFooNr9rrrrr<�sr<r?rXc@seZdZdS)zNComponentsTests.test_registeredSubscriptionAdapters_notempty.<locals>._FactoryNr9rrrrr��sr�r@rlrY)rAr8r[rrBrrr�r!r!r^r$r%rr_r�rr?rL)r
r8rr<rDr�rErr�r,r�rrr�,test_registeredSubscriptionAdapters_notempty�s6z<ComponentsTests.test_registeredSubscriptionAdapters_notemptycCsRddlm}Gdd�d|�}|d�}|d�}d}|��}|jt|j|||d�dS)NrrSc@seZdZdS)zPComponentsTests.test_unregisterSubscriptionAdapter_w_nonblank_name.<locals>.IFooNr9rrrrr<�sr<r��nonblank)r�r_r�rAr8rrNrO�unregisterSubscriptionAdapter)r
r8r<rDr��	_nonblankr,rrr�2test_unregisterSubscriptionAdapter_w_nonblank_name�s
�zBComponentsTests.test_unregisterSubscriptionAdapter_w_nonblank_namecCs |��}|jt|jddd�dSr�)rrNrOr&r1rrr�?test_unregisterSubscriptionAdapter_neither_factory_nor_provided�s

�zOComponentsTests.test_unregisterSubscriptionAdapter_neither_factory_nor_providedcCsFddlm}Gdd�d|�}|d�}|��}|jt|jd|dd�dS)NrrSc@seZdZdS)z]ComponentsTests.test_unregisterSubscriptionAdapter_neither_factory_nor_required.<locals>.IFooNr9rrrrr<�sr<r�r%r�rrr�?test_unregisterSubscriptionAdapter_neither_factory_nor_required�s
�zOComponentsTests.test_unregisterSubscriptionAdapter_neither_factory_nor_requiredc
	Cs�ddlm}Gdd�d|�}|d�}|d�}Gdd�dt�}|��}|��\}}|�|�||f|�}	W5QRX|�|	�|�|�dS)NrrSc@seZdZdS)zEComponentsTests.test_unregisterSubscriptionAdapter_miss.<locals>.IFooNr9rrrrr<�sr<r�c@seZdZdS)zIComponentsTests.test_unregisterSubscriptionAdapter_miss.<locals>._FactoryNr9rrrrr��sr�)rAr8rBrrr&r�r�rrr�'test_unregisterSubscriptionAdapter_miss�s
z7ComponentsTests.test_unregisterSubscriptionAdapter_missc	Csxddlm}ddlm}ddlm}Gdd�d|�}|d�}|d�}Gdd	�d	t�}|��}|�||f|�|�	�\}	}
|	�|�
d|f|�}W5QRX|�|�|�|j
j�|�|j�|�t|
�d
�|
d\}}
|\}|�|
i�|�t||��|�t|j|��|�|jj|k�|�|jj|k�|�|jj|f�|�|jjd�|�|jjd�|�|jjdk�dS)NrrSrurc@seZdZdS)zOComponentsTests.test_unregisterSubscriptionAdapter_hit_wo_factory.<locals>.IFooNr9rrrrr<�sr<r�c@seZdZdS)zSComponentsTests.test_unregisterSubscriptionAdapter_hit_wo_factory.<locals>._FactoryNr9rrrrr��sr�rYrX�rAr8rZrvr[rrBrrrr&r$r�r&r]r*r!r^r%rr_r�rr?rL�r
r8rvrr<rDr�r�r,rrr�rrrarrr�1test_unregisterSubscriptionAdapter_hit_wo_factory�s6
zAComponentsTests.test_unregisterSubscriptionAdapter_hit_wo_factoryc	Csxddlm}ddlm}ddlm}Gdd�d|�}|d�}|d�}Gdd	�d	t�}|��}|�||f|�|�	�\}	}
|	�|�
||f|�}W5QRX|�|�|�|j
j�|�|j�|�t|
�d
�|
d\}}
|\}|�|
i�|�t||��|�t|j|��|�|jj|k�|�|jj|k�|�|jj|f�|�|jjd�|�|jjd�|�|jj|k�dS)NrrSrurc@seZdZdS)zNComponentsTests.test_unregisterSubscriptionAdapter_hit_w_factory.<locals>.IFooNr9rrrrr<sr<r�c@seZdZdS)zRComponentsTests.test_unregisterSubscriptionAdapter_hit_w_factory.<locals>._FactoryNr9rrrrr�sr�rYrXr,r-rrr�0test_unregisterSubscriptionAdapter_hit_w_factory�s6
z@ComponentsTests.test_unregisterSubscriptionAdapter_hit_w_factoryc	Cspddlm}ddlm}ddlm}ddlm}Gdd�d|�}|d�}|d�}||�Gd	d
�d
t��}|��}	|	�	||f|�|�
�\}
}|
�|	�||f�}W5QRX|�|�|�
t|�d�|d\}
}|
\}|�
|i�|�t||��|�t|j|��|�|jj|	k�|�|jj|k�|�
|jj|f�|�
|jjd�|�
|jjd�|�|jj|k�dS)
NrrSr�rurc@seZdZdS)zUComponentsTests.test_unregisterSubscriptionAdapter_wo_explicit_provided.<locals>.IFooNr9rrrrr<$sr<r�c@seZdZdS)zYComponentsTests.test_unregisterSubscriptionAdapter_wo_explicit_provided.<locals>._FactoryNr9rrrrr�(sr�rYrX)rAr8r�rZrvr[rrBrrrr&r$r!r^r%rr_r�rr?rL)r
r8r�rvrr<rDr�r�r,rrr�rrrarrr�7test_unregisterSubscriptionAdapter_wo_explicit_provideds6
zGComponentsTests.test_unregisterSubscriptionAdapter_wo_explicit_providedc	s`ddlm}ddlm}ddlm}Gdd�d|�}|d�}|d��G�fdd	�d	t�}|��}|�|�f|�|�	�\}}	|�|j
||d
�}
W5QRX|�|
�|�t
|	�d�|	d\}}|\}
|�|i�|�t|
|��|�t|
j|��|�|
jj|k�|�|
jj|k�|�|
jj�f�|�|
jjd�|�|
jjd�|�|
jj|k�dS)
NrrSrurc@seZdZdS)zUComponentsTests.test_unregisterSubscriptionAdapter_wo_explicit_required.<locals>.IFooNr9rrrrr<Csr<r�cseZdZ�fZdS)zYComponentsTests.test_unregisterSubscriptionAdapter_wo_explicit_required.<locals>._FactoryNr�rr�rrr�Gsr�r�rYrX)rAr8rZrvr[rrBrrrr&r$r!r^r%rr_r�rr?rL)r
r8rvrr<rDr�r,rrr�rrrarr�r�7test_unregisterSubscriptionAdapter_wo_explicit_required?s2
zGComponentsTests.test_unregisterSubscriptionAdapter_wo_explicit_requiredc	Cs|ddlm}ddlm}Gdd�d|�}|d�}|d�}|��}||�Gdd�dt��}|�}|�t|�|f|��g�dS)	NrrSr�c@seZdZdS)z4ComponentsTests.test_subscribers_empty.<locals>.IFooNr9rrrrr<`sr<r�c@seZdZdS)z3ComponentsTests.test_subscribers_empty.<locals>.BarNr9rrrr�Baresr2)rAr8r�rrBr!r��subscribers)	r
r8r�r<rDr�r,r2�barrrr�test_subscribers_empty]sz&ComponentsTests.test_subscribers_emptycsddlm}ddlm}Gdd�d|�}|d�}|d��G�fdd�dt�}Gd	d
�d
|�}|��}|�|�f|�|�|�f|�|��Gdd�dt��}|�}	|�|	f|�}
d
d�}t|
|d�}
|�t	|
�d�|�
t|
d|��|�
t|
d|��dS)NrrSr�c@seZdZdS)z8ComponentsTests.test_subscribers_non_empty.<locals>.IFooNr9rrrrr<nsr<r�cseZdZ�fZdd�ZdS)z<ComponentsTests.test_subscribers_non_empty.<locals>._FactorycSs
||_dSr)r�r�rrrr�tszEComponentsTests.test_subscribers_non_empty.<locals>._Factory.__init__N)r"r:r;r�r�rr�rrr�rsr�c@seZdZdS)z<ComponentsTests.test_subscribers_non_empty.<locals>._DerivedNr9rrrr�_Derivedvsr6c@seZdZdS)z7ComponentsTests.test_subscribers_non_empty.<locals>.BarNr9rrrrr2{sr2cSs|jjSr)r�r"��xrrr�
_klassname�sz>ComponentsTests.test_subscribers_non_empty.<locals>._klassnamer�rlrY)rAr8r�rBrrr3r�r!r^r$r%)r
r8r�r<rDr�r6r,r2r4r3r9rr�r�test_subscribers_non_emptyks&z*ComponentsTests.test_subscribers_non_emptycCsRddlm}Gdd�d|�}|d�}d}|��}dd�}|jt|j|||d�dS)	NrrSc@seZdZdS)zBComponentsTests.test_registerHandler_w_nonblank_name.<locals>.IFooNr9rrrrr<�sr<r$cSs
t��dSrrGr�rrrrI�szFComponentsTests.test_registerHandler_w_nonblank_name.<locals>._factory�r�r)rAr8rrNrO�registerHandler)r
r8r<rDr'r,rIrrr�$test_registerHandler_w_nonblank_name�s�z4ComponentsTests.test_registerHandler_w_nonblank_namec	Cs�ddlm}ddlm}ddlm}Gdd�d|�}|d�}d}d}d	d
�}|��}	|��\}
}|
�|	j||f|d�W5QRX|	j	j
d|d|}|�t|�d�|�
|d|k�|�|	j|f|||fg�|�t|�d�|d\}
}|
\}|�|i�|�
t||��|�
t|j|��|�
|jj|	k�|�|jj|f�|�|jj|�|�
|jj|k�|�
|jj|k�dS)
NrrSrT��HandlerRegistrationc@seZdZdS)zFComponentsTests.test_registerHandler_w_explicit_required.<locals>.IFooNr9rrrrr<�sr<rXr?cSs
t��dSrrGr�rrrrI�szJComponentsTests.test_registerHandler_w_explicit_required.<locals>._factoryr@rY)rAr8rZrUr[r?rrr<r&r]r!r^r$r+r%rBrr�rr?rL)r
r8rUr?r<rDrrErIr,rrr�rrrarrr�(test_registerHandler_w_explicit_required�s:�z8ComponentsTests.test_registerHandler_w_explicit_requiredc
	s�ddlm}Gdd�d|�}|d��d}d}G�fdd�dt�}|��}|��\}}|�|j||d	d
�W5QRX|jjd�d|}	|�t	|	�d�|�
|	d|k�|�|j�f|||fg�|�t	|�d�dS)NrrSc@seZdZdS)zPComponentsTests.test_registerHandler_wo_explicit_required_no_event.<locals>.IFooNr9rrrrr<�sr<r?rXcseZdZ�fZdS)zTComponentsTests.test_registerHandler_wo_explicit_required_no_event.<locals>._FactoryNr�r�rDrrr��sr�FrrY)rAr8rBrrr<r&r]r!r^r$r+)
r
r8r<rErr�r,rrr�rrAr�2test_registerHandler_wo_explicit_required_no_event�s"�zBComponentsTests.test_registerHandler_wo_explicit_required_no_eventcCs|��}|�t|����dSr)rr�r��registeredHandlersr1rrr�test_registeredHandlers_empty�sz-ComponentsTests.test_registeredHandlers_emptyc
CsLddlm}ddlm}Gdd�d|�}|d�}dd�}dd	�}|��}|�||f�|�||f�d
d�}t|��|d�}	|�t	|	�d
�|�
t|	d|��|�|	dj|f�|�|	dj
d�|�|	dj|�|�|	djd�|�
t|	d|��|�|	dj|f�|�|	dj
d�|�|	dj|�|�|	djd�dS)NrrSr>c@seZdZdS)z?ComponentsTests.test_registeredHandlers_non_empty.<locals>.IFooNr9rrrrr<�sr<cSs
t��dSrrGr�rrr�	_factory1�szDComponentsTests.test_registeredHandlers_non_empty.<locals>._factory1cSs
t��dSrrGr�rrr�	_factory2�szDComponentsTests.test_registeredHandlers_non_empty.<locals>._factory2cSs
|jjjSr)rL�__code__�co_namer7rrr�
_factory_name�szHComponentsTests.test_registeredHandlers_non_empty.<locals>._factory_namer�rlrXrY)rAr8r[r?rr<r�rCr!r^r$r%r�rrLr?)
r
r8r?r<rDrErFr,rIr3rrr�!test_registeredHandlers_non_empty�s,z1ComponentsTests.test_registeredHandlers_non_emptycCsJddlm}Gdd�d|�}|d�}d}|��}|jt|j|f|d�dS)NrrSc@seZdZdS)zDComponentsTests.test_unregisterHandler_w_nonblank_name.<locals>.IFooNr9rrrrr<�sr<r$r;)rAr8rrNrO�unregisterHandler)r
r8r<rDr'r,rrr�&test_unregisterHandler_w_nonblank_name�s
�z6ComponentsTests.test_unregisterHandler_w_nonblank_namecCs|��}|�t|j�dSr)rrNrOrKr1rrr�3test_unregisterHandler_neither_factory_nor_required�szCComponentsTests.test_unregisterHandler_neither_factory_nor_requiredcCsHddlm}Gdd�d|�}|d�}|��}|j|fd�}|�|�dS)NrrSc@seZdZdS)z9ComponentsTests.test_unregisterHandler_miss.<locals>.IFooNr9rrrrr<�sr<�r�)rAr8rrKr�)r
r8r<rDr,r�rrr�test_unregisterHandler_miss�sz+ComponentsTests.test_unregisterHandler_missc	Cs0ddlm}ddlm}ddlm}Gdd�d|�}|d�}|��}dd�}|��}|�||f�|��\}}	|�|�	||f�}
W5QRX|�
|
�|�t|	�d	�|	d\}}|\}
|�|i�|�
t
|
|��|�
t
|
j|��|�
|
jj|k�|�|
jj|f�|�|
jjd
�|�
|
jj|k�dS)NrrSrur>c@seZdZdS)zXComponentsTests.test_unregisterHandler_hit_w_factory_and_explicit_provided.<locals>.IFooNr9rrrrr<
sr<cSs
t��dSrrGr�rrrrIsz\ComponentsTests.test_unregisterHandler_hit_w_factory_and_explicit_provided.<locals>._factoryrYrX�rAr8rZrvr[r?rr<rrKr$r!r^r%rBrr�rrL�r
r8rvr?r<rDr,rIrrr�rrrarrr�:test_unregisterHandler_hit_w_factory_and_explicit_provideds.
zJComponentsTests.test_unregisterHandler_hit_w_factory_and_explicit_providedc	Cs0ddlm}ddlm}ddlm}Gdd�d|�}|d�}|��}dd�}|��}|�||f�|��\}}	|�|j	|fd	�}
W5QRX|�
|
�|�t|	�d
�|	d\}}|\}
|�|i�|�
t
|
|��|�
t
|
j|��|�
|
jj|k�|�|
jj|f�|�|
jjd�|�
|
jjdk�dS)NrrSrur>c@seZdZdS)zQComponentsTests.test_unregisterHandler_hit_w_only_explicit_provided.<locals>.IFooNr9rrrrr<%sr<cSs
t��dSrrGr�rrrrI)szUComponentsTests.test_unregisterHandler_hit_w_only_explicit_provided.<locals>._factoryrNrYrXrPrQrrr�3test_unregisterHandler_hit_w_only_explicit_provided!s.
zCComponentsTests.test_unregisterHandler_hit_w_only_explicit_providedc
	s<ddlm}ddlm}ddlm}Gdd�d|�}|d��G�fdd�dt�}|��}|�|�|�	�\}}|�|�
|�}	W5QRX|�|	�|�t
|�d	�|d\}
}|
\}|�|i�|�t||��|�t|j|��|�|jj|k�|�|jj�f�|�|jjd
�|�|jjd
�|�|jj|k�dS)NrrSrur>c@seZdZdS)zIComponentsTests.test_unregisterHandler_wo_explicit_required.<locals>.IFooNr9rrrrr<@sr<cseZdZ�fZdS)zMComponentsTests.test_unregisterHandler_wo_explicit_required.<locals>._FactoryNr�rrArrr�Csr�rYrX)rAr8rZrvr[r?rBrr<rrKr$r!r^r%rr�rr?rL)
r
r8rvr?r<r�r,rrr�rrrarrAr�+test_unregisterHandler_wo_explicit_required<s.

z;ComponentsTests.test_unregisterHandler_wo_explicit_requiredcCsfddlm}ddlm}Gdd�d|�}|d�}|��}||�Gdd�dt��}|�}|�|f�dS)NrrSr�c@seZdZdS)z/ComponentsTests.test_handle_empty.<locals>.IFooNr9rrrrr<[sr<c@seZdZdS)z.ComponentsTests.test_handle_empty.<locals>.BarNr9rrrrr2_sr2)rAr8r�rrB�handle)r
r8r�r<rDr,r2r4rrr�test_handle_emptyXsz!ComponentsTests.test_handle_emptyc
s�ddlm}ddlm}Gdd�d|�}|d�}g��fdd�}g��fdd	�}|��}|�||f�|�||f�||�Gd
d�dt��}|�}	|�|	�|��|	g�|��|	g�dS)NrrSr�c@seZdZdS)z3ComponentsTests.test_handle_non_empty.<locals>.IFooNr9rrrrr<hsr<cs��|�dSrrr�)�	_called_1rr�
_factory_1lsz9ComponentsTests.test_handle_non_empty.<locals>._factory_1cs��|�dSrrr�)�	_called_2rr�
_factory_2osz9ComponentsTests.test_handle_non_empty.<locals>._factory_2c@seZdZdS)z2ComponentsTests.test_handle_non_empty.<locals>.BarNr9rrrrr2tsr2)rAr8r�rr<rBrUr!)
r
r8r�r<rDrXrZr,r2r4r)rWrYr�test_handle_non_emptyes"
z%ComponentsTests.test_handle_non_emptyN)r)nr"r:r;r
rrr-r/r2r5rFrRrbrerfrirkrnrtrwryrzr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrr
rr
rrrrrrrr r"r#r(r)r*r+r.r/r0r1r5r:r=r@rBrDrJrLrMrOrRrSrTrVr[rrrrrs�
  )"#	
	
#'#*$	  "	#$'%!	   "	
rcseZdZ�fdd�Z�ZS)�UnhashableComponentsTestscs Gdd�dtt|���t�}|S)Nc@seZdZdS)z=UnhashableComponentsTests._getTargetClass.<locals>.ComponentsNr9rrrrr�sr)r|r\r
r})r
rr�rrr
sz)UnhashableComponentsTests._getTargetClass)r"r:r;r
r�rrr�rr\}sr\c@s�eZdZdd�Zd6dd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�ZdS)7�UtilityRegistrationTestscCsddlm}|S)NrrV)r[rW)r
rWrrrr
�sz(UtilityRegistrationTests._getTargetClassNcCsbddlm}Gdd�d|�}|d�}Gdd�dt�}|�}d}d}	|��}
|
|||||	|�||fS)	NrrSc@seZdZdS)z/UtilityRegistrationTests._makeOne.<locals>.IFooNr9rrrrr<�sr<c@seZdZdd�ZdS)z4UtilityRegistrationTests._makeOne.<locals>._RegistrycSsdS�NZ	_REGISTRYrr	rrr�__repr__�sz=UtilityRegistrationTests._makeOne.<locals>._Registry.__repr__N�r"r:r;r_rrrr�	_Registry�srar�	DOCSTRING�rAr8rBr
)r
rKrLr8r<rDrarr�doc�klassrrrr�s�z!UtilityRegistrationTests._makeOnecCs*ddlm}ddlm}|||���dS)Nr��verifyClass��IUtilityRegistration)�zope.interface.verifyrgrZrir
)r
rgrirrr�+test_class_conforms_to_IUtilityRegistration�szDUtilityRegistrationTests.test_class_conforms_to_IUtilityRegistrationcCs4ddlm}ddlm}|��\}}}|||�dS)Nr��verifyObjectrh)rjrmrZrir)r
rmri�ur�_rrr�.test_instance_conforms_to_IUtilityRegistration�szGUtilityRegistrationTests.test_instance_conforms_to_IUtilityRegistrationcCs>Gdd�dt�}|�}|�|�\}}}|�t|�d|�dS)Nc@seZdZdZdS)z:UtilityRegistrationTests.test___repr__.<locals>._Component�TESTNr9rrrr�
_Component�srrzAUtilityRegistration(_REGISTRY, IFoo, %r, TEST, None, 'DOCSTRING')�rBrr!r0�r
rr�
_componentrn�	_registryr`rrrr2�s
��z&UtilityRegistrationTests.test___repr__cCsFGdd�dt�}|�}|�|�\}}}t�|_|�t|�d|�dS)Nc@seZdZdd�ZdS)zKUtilityRegistrationTests.test___repr___provided_wo_name.<locals>._ComponentcSsdS�Nrqrr	rrrr_�szTUtilityRegistrationTests.test___repr___provided_wo_name.<locals>._Component.__repr__Nr`rrrrrr�srr�AUtilityRegistration(_REGISTRY, None, %r, TEST, None, 'DOCSTRING')�rBrr_r!r0rtrrr�test___repr___provided_wo_name�s
��z7UtilityRegistrationTests.test___repr___provided_wo_namecCsFGdd�dt�}|�}|�|�\}}}t�|_|�t|�d|�dS)Nc@seZdZdd�ZdS)zLUtilityRegistrationTests.test___repr___component_wo_name.<locals>._ComponentcSsdSrwrr	rrrr_�szUUtilityRegistrationTests.test___repr___component_wo_name.<locals>._Component.__repr__Nr`rrrrrr�srrrxryrtrrr�test___repr___component_wo_name�s
��z8UtilityRegistrationTests.test___repr___component_wo_namecCs.t�}|�|�\}}}|�|��t|��dSr�rBrr!�__hash__�id�r
rurnrvr`rrr�
test___hash__�sz&UtilityRegistrationTests.test___hash__cCs(t�}|�|�\}}}|�||k�dSr�rBrr$rrrr�test___eq___identity�sz-UtilityRegistrationTests.test___eq___identitycCs8t�}|�|�\}}}|�|�\}}}|�||k�dSrr��r
rurnrvr`�ur2rorrr�test___eq___hit�sz(UtilityRegistrationTests.test___eq___hitcCs>t�}t�}|�|�\}}}|�|�\}}}|�||k�dSr�rBrr��r
ru�_component2rnrvr`r�rorrr�test___eq___miss�s
z)UtilityRegistrationTests.test___eq___misscCs(t�}|�|�\}}}|�||k�dSrr�rrrr�test___ne___identity�sz-UtilityRegistrationTests.test___ne___identitycCs8t�}|�|�\}}}|�|�\}}}|�||k�dSrr�r�rrr�test___ne___hit�sz(UtilityRegistrationTests.test___ne___hitcCs>t�}t�}|�|�\}}}|�|�\}}}|�||k�dSrr�r�rrr�test___ne___miss�s
z)UtilityRegistrationTests.test___ne___misscCs(t�}|�|�\}}}|�||k�dSrr�rrrr�test___lt___identity�sz-UtilityRegistrationTests.test___lt___identitycCs8t�}|�|�\}}}|�|�\}}}|�||k�dSrr�r�rrr�test___lt___hit�sz(UtilityRegistrationTests.test___lt___hitcCsHt�}t�}|�|�\}}}|�|�\}}}|d|_|�||k�dS�N�2�rBrrr$r�rrr�test___lt___miss	s
z)UtilityRegistrationTests.test___lt___misscCs(t�}|�|�\}}}|�||k�dSrr�rrrr�test___le___identity	sz-UtilityRegistrationTests.test___le___identitycCs8t�}|�|�\}}}|�|�\}}}|�||k�dSrr�r�rrr�test___le___hit
	sz(UtilityRegistrationTests.test___le___hitcCsHt�}t�}|�|�\}}}|�|�\}}}|d|_|�||k�dSr�r�r�rrr�test___le___miss	s
z)UtilityRegistrationTests.test___le___misscCs(t�}|�|�\}}}|�||k�dSrr�rrrr�test___gt___identity	sz-UtilityRegistrationTests.test___gt___identitycCsHt�}t�}|�|�\}}}|�|�\}}}|d|_|�||k�dSr�r�r�rrr�test___gt___hit 	s
z(UtilityRegistrationTests.test___gt___hitcCs8t�}|�|�\}}}|�|�\}}}|�||k�dSrr�r�rrr�test___gt___miss(	sz)UtilityRegistrationTests.test___gt___misscCs(t�}|�|�\}}}|�||k�dSrr�rrrr�test___ge___identity.	sz-UtilityRegistrationTests.test___ge___identitycCsHt�}t�}|�|�\}}}|�|�\}}}|d|_|�||k�dSr��rBrrr�r�rrr�test___ge___miss3	s
z)UtilityRegistrationTests.test___ge___misscCsBt�}|�|�\}}}|�|�\}}}|d|_|�||k�dSr�r�r�rrr�test___ge___hit;	s

z(UtilityRegistrationTests.test___ge___hit)NN)r"r:r;r
rrkrpr2rzr{r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr]�s4
	r]c@s�eZdZdd�Zd:dd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�ZdS);�AdapterRegistrationTestscCsddlm}|S)Nrr�)r[r�)r
r�rrrr
E	sz(AdapterRegistrationTests._getTargetClassNcCslddlm}Gdd�d|�}|d�}|d�}Gdd�dt�}|�}d}d	}	|��}
|
||f||||	�||fS)
NrrSc@seZdZdS)z/AdapterRegistrationTests._makeOne.<locals>.IFooNr9rrrrr<L	sr<r�c@seZdZdd�ZdS)z4AdapterRegistrationTests._makeOne.<locals>._RegistrycSsdSr^rr	rrrr_Q	sz=AdapterRegistrationTests._makeOne.<locals>._Registry.__repr__Nr`rrrrraP	srarrbrc�r
rKr8r<rDr�rarrrdrerrrrI	s�z!AdapterRegistrationTests._makeOnecCs*ddlm}ddlm}|||���dS)Nrrf��IAdapterRegistration)rjrgrZr�r
)r
rgr�rrr�+test_class_conforms_to_IAdapterRegistration\	szDAdapterRegistrationTests.test_class_conforms_to_IAdapterRegistrationcCs4ddlm}ddlm}|��\}}}|||�dS)Nrrlr�)rjrmrZr�r)r
rmr��arrorrr�.test_instance_conforms_to_IAdapterRegistrationa	szGAdapterRegistrationTests.test_instance_conforms_to_IAdapterRegistrationcCs>Gdd�dt�}|�}|�|�\}}}|�t|�d|�dS)Nc@seZdZdZdS)z:AdapterRegistrationTests.test___repr__.<locals>._ComponentrqNr9rrrrrrh	srrzCAdapterRegistration(_REGISTRY, [IBar], IFoo, %r, TEST, 'DOCSTRING')rs�r
rrrur�rvr`rrrr2g	s
��z&AdapterRegistrationTests.test___repr__cCsFGdd�dt�}|�}|�|�\}}}t�|_|�t|�d|�dS)Nc@seZdZdd�ZdS)zKAdapterRegistrationTests.test___repr___provided_wo_name.<locals>._ComponentcSsdSrwrr	rrrr_r	szTAdapterRegistrationTests.test___repr___provided_wo_name.<locals>._Component.__repr__Nr`rrrrrrq	srr�CAdapterRegistration(_REGISTRY, [IBar], None, %r, TEST, 'DOCSTRING')ryr�rrrrzp	s
��z7AdapterRegistrationTests.test___repr___provided_wo_namecCsFGdd�dt�}|�}|�|�\}}}t�|_|�t|�d|�dS)Nc@seZdZdd�ZdS)zLAdapterRegistrationTests.test___repr___component_wo_name.<locals>._ComponentcSsdSrwrr	rrrr_}	szUAdapterRegistrationTests.test___repr___component_wo_name.<locals>._Component.__repr__Nr`rrrrrr|	srrr�ryr�rrrr{{	s
��z8AdapterRegistrationTests.test___repr___component_wo_namecCs.t�}|�|�\}}}|�|��t|��dSrr|�r
rur�rvr`rrrr��	sz&AdapterRegistrationTests.test___hash__cCs(t�}|�|�\}}}|�||k�dSrr�r�rrrr��	sz-AdapterRegistrationTests.test___eq___identitycCs8t�}|�|�\}}}|�|�\}}}|�||k�dSrr��r
rur�rvr`�ar2rorrrr��	sz(AdapterRegistrationTests.test___eq___hitcCs>t�}t�}|�|�\}}}|�|�\}}}|�||k�dSrr��r
rur�r�rvr`r�rorrrr��	s
z)AdapterRegistrationTests.test___eq___misscCs(t�}|�|�\}}}|�||k�dSrr�r�rrrr��	sz-AdapterRegistrationTests.test___ne___identitycCs8t�}|�|�\}}}|�|�\}}}|�||k�dSrr�r�rrrr��	sz)AdapterRegistrationTests.test___ne___misscCs>t�}t�}|�|�\}}}|�|�\}}}|�||k�dSrr�r�rrr�test___ne___hit_component�	s
z2AdapterRegistrationTests.test___ne___hit_componentc
Csbddlm}Gdd�d|�}|d�}t�}|�|�\}}}|�|�\}}	}	||_|�||k�dS)NrrSc@seZdZdS)z?AdapterRegistrationTests.test___ne___hit_provided.<locals>.IFooNr9rrrrr<�	sr<r�)rAr8rBrr_r$)
r
r8r<rrur�rvr`r�rorrr�test___ne___hit_provided�	sz1AdapterRegistrationTests.test___ne___hit_providedcCsjddlm}Gdd�d|�}|d�}t�}t�}|�|�\}}}|�|�\}	}
}
|f|	_|�||	k�dS)NrrSc@seZdZdS)z?AdapterRegistrationTests.test___ne___hit_required.<locals>.IFooNr9rrrrr<�	sr<r�)rAr8rBrr�r$)r
r8r<rrur�r�rvr`r�rorrr�test___ne___hit_required�	sz1AdapterRegistrationTests.test___ne___hit_requiredcCs(t�}|�|�\}}}|�||k�dSrr�r�rrrr��	sz-AdapterRegistrationTests.test___lt___identitycCs8t�}|�|�\}}}|�|�\}}}|�||k�dSrr�r�rrrr��	sz(AdapterRegistrationTests.test___lt___hitcCsHt�}t�}|�|�\}}}|�|�\}}}|d|_|�||k�dSr�r�r�rrrr��	s
z)AdapterRegistrationTests.test___lt___misscCs(t�}|�|�\}}}|�||k�dSrr�r�rrrr��	sz-AdapterRegistrationTests.test___le___identitycCs8t�}|�|�\}}}|�|�\}}}|�||k�dSrr�r�rrrr��	sz(AdapterRegistrationTests.test___le___hitcCsHt�}t�}|�|�\}}}|�|�\}}}|d|_|�||k�dSr�r�r�rrrr��	s
z)AdapterRegistrationTests.test___le___misscCs(t�}|�|�\}}}|�||k�dSrr�r�rrrr��	sz-AdapterRegistrationTests.test___gt___identitycCsHt�}t�}|�|�\}}}|�|�\}}}|d|_|�||k�dSr�r�r�rrrr��	s
z(AdapterRegistrationTests.test___gt___hitcCs8t�}|�|�\}}}|�|�\}}}|�||k�dSrr�r�rrrr��	sz)AdapterRegistrationTests.test___gt___misscCs(t�}|�|�\}}}|�||k�dSrr�r�rrrr��	sz-AdapterRegistrationTests.test___ge___identitycCsHt�}t�}|�|�\}}}|�|�\}}}|d|_|�||k�dSr�r�r�rrrr�
s
z)AdapterRegistrationTests.test___ge___misscCsBt�}|�|�\}}}|�|�\}}}|d|_|�||k�dSr�r�r�rrrr�
s

z(AdapterRegistrationTests.test___ge___hit)N)r"r:r;r
rr�r�r2rzr{r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr�C	s8
	r�c@s.eZdZdd�Zd
dd�Zdd�Zdd	�ZdS)�SubscriptionRegistrationTestscCsddlm}|S)Nrr)r[r)r
rrrrr

sz-SubscriptionRegistrationTests._getTargetClassNcCslddlm}Gdd�d|�}|d�}|d�}Gdd�dt�}|�}d}d	}	|��}
|
||f||||	�||fS)
NrrSc@seZdZdS)z4SubscriptionRegistrationTests._makeOne.<locals>.IFooNr9rrrrr<
sr<r�c@seZdZdd�ZdS)z9SubscriptionRegistrationTests._makeOne.<locals>._RegistrycSsdSr^rr	rrrr_"
szBSubscriptionRegistrationTests._makeOne.<locals>._Registry.__repr__Nr`rrrrra!
srarrbrcr�rrrr
s�z&SubscriptionRegistrationTests._makeOnecCs*ddlm}ddlm}|||���dS)Nrrf�� ISubscriptionAdapterRegistration)rjrgrZr�r
)r
rgr�rrr�7test_class_conforms_to_ISubscriptionAdapterRegistration-
szUSubscriptionRegistrationTests.test_class_conforms_to_ISubscriptionAdapterRegistrationcCs4ddlm}ddlm}|��\}}}|||�dS)Nrrlr�)rjrmrZr�r)r
rmr�Zsarrorrr�:test_instance_conforms_to_ISubscriptionAdapterRegistration2
szXSubscriptionRegistrationTests.test_instance_conforms_to_ISubscriptionAdapterRegistration)N)r"r:r;r
rr�r�rrrrr�
s
r�c@sFeZdZdd�Zddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dS)�HandlerRegistrationTestscCsddlm}|S)Nrr>)r[r?)r
r?rrrr
;
sz(HandlerRegistrationTests._getTargetClassNc
Csbddlm}Gdd�d|�}|d�}Gdd�dt�}|�}d}d}|��}	|	||f|||�||fS)	NrrSc@seZdZdS)z/HandlerRegistrationTests._makeOne.<locals>.IFooNr9rrrrr<B
sr<c@seZdZdd�ZdS)z4HandlerRegistrationTests._makeOne.<locals>._RegistrycSsdSr^rr	rrrr_F
sz=HandlerRegistrationTests._makeOne.<locals>._Registry.__repr__Nr`rrrrraE
srarrbrc)
r
rKr8r<rDrarrrdrerrrr?
s�z!HandlerRegistrationTests._makeOnecCs*ddlm}ddlm}|||���dS)Nrrf��IHandlerRegistration)rjrgrZr�r
)r
rgr�rrr�+test_class_conforms_to_IHandlerRegistrationQ
szDHandlerRegistrationTests.test_class_conforms_to_IHandlerRegistrationcCs4ddlm}ddlm}|��\}}}|||�dS)Nrrlr�)rjrmrZr�r)r
rmr��hrrorrr�.test_instance_conforms_to_IHandlerRegistrationV
szGHandlerRegistrationTests.test_instance_conforms_to_IHandlerRegistrationcCsNdd�}|�|�\}}}|�|j|k�|�|j|jk�|�|jdk�dS)NcSs
t��dSrrGr�rrrrI]
sz:HandlerRegistrationTests.test_properties.<locals>._factory)rr$ZhandlerrLr_)r
rIr�rorrr�test_properties\
s
z(HandlerRegistrationTests.test_propertiescCs:Gdd�dt�}|�|��\}}}|�t|�d|�dS)Nc@seZdZdZdS)zGHandlerRegistrationTests.test___repr___factory_w_name.<locals>._FactoryrqNr9rrrrr�e
sr��=HandlerRegistration(_REGISTRY, [IFoo], %r, TEST, 'DOCSTRING')rs�r
r�r�rvr`rrr�test___repr___factory_w_named
s
��z5HandlerRegistrationTests.test___repr___factory_w_namecCs:Gdd�dt�}|�|��\}}}|�t|�d|�dS)Nc@seZdZdd�ZdS)zHHandlerRegistrationTests.test___repr___factory_wo_name.<locals>._FactorycSsdSrwrr	rrrr_n
szQHandlerRegistrationTests.test___repr___factory_wo_name.<locals>._Factory.__repr__Nr`rrrrr�m
sr�r�rsr�rrr�test___repr___factory_wo_namel
s
��z6HandlerRegistrationTests.test___repr___factory_wo_name)N)
r"r:r;r
rr�r�r�r�r�rrrrr�9
s
r�c@seZdZdd�Zdd�ZdS)�PersistentAdapterRegistrycCsF|j��}t|�D]"}||jks*|�d�r|�|�q|�dd�|S)NZ_vZro)�__dict__�copyr�Z
_delegated�
startswith�pop)r
�state�krrr�__getstate__w
s
z&PersistentAdapterRegistry.__getstate__cCs6|�dd�}|j�|�|��||_|j�|�dS)Nr#r)r�r��updateZ
_createLookupr#Z	_v_lookupZchanged)r
r��basesrrr�__setstate__
s
z&PersistentAdapterRegistry.__setstate__N)r"r:r;r�r�rrrrr�u
sr�c@seZdZdd�ZdS)�PersistentComponentscCst�|_t�|_dSr)r�r&r'r	rrr�_init_registries�
sz%PersistentComponents._init_registriesN)r"r:r;r�rrrrr��
sr�c@seZdZdS)�PersistentDictComponentsNr9rrrrr��
sr�c@seZdZdd�ZdS)�PersistentComponentsDictcCst�|�t�||�dSr)r}r�r�)r
rrrrr��
s
z!PersistentComponentsDict.__init__Nr�rrrrr��
sr�c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�TestPersistentComponentscCstd�S)Nr)r�r	rrrr�
sz!TestPersistentComponents._makeOnecCsdSrr�r
Zmaderrr�_check_equality_after_pickle�
sz5TestPersistentComponents._check_equality_after_picklecCs<ddl}|��}|�|�|�|�|��}|�|jd�dS�Nrr)�pickler�dumps�loadsr!r")r
r�r,�comp2rrr�test_pickles_empty�
s

z+TestPersistentComponents.test_pickles_emptycCs�ddl}|��}t�}|�|t�|�||�t��|�|�|��}|�	|j
d�|�|�t��|�|t�|�||�t��|�|�dSr�)
r�rrBrCrZassertIsr�r�r�r!r"ZassertIsNotNoner�)r
r�r,Zutilityr�rrr�&test_pickles_with_utility_registration�
s*����z?TestPersistentComponents.test_pickles_with_utility_registrationN)r"r:r;rr�r�r�rrrrr��
sr�c@s$eZdZdd�Zdd�Zdd�ZdS)�TestPersistentDictComponentscCstSr)r�r	rrrr
�
sz,TestPersistentDictComponents._getTargetClasscCs|��dd�}d|d<|S)Nrr��*r�rr1rrrr�
sz%TestPersistentDictComponents._makeOnecCs |�d|�|�|dd�dS)Nr�r�)ZassertInr!r�rrrr��
sz9TestPersistentDictComponents._check_equality_after_pickleN)r"r:r;r
rr�rrrrr��
sr�c@seZdZdd�ZdS)�TestPersistentComponentsDictcCstSr)r�r	rrrr
�
sz,TestPersistentComponentsDict._getTargetClassN)r"r:r;r
rrrrr��
sr�c@s$eZdZdd�Zdd�Zdd�ZdS)rcs@�|_t�fdd�|D��|_|��D]\}}t�||�q&dS)Ncsg|]}|t�|�f�qSr)�getattr)�.0r���modulerr�
<listcomp>�
sz$_Monkey.__init__.<locals>.<listcomp>)r�r}�
to_restore�items�setattr)r
r�rr��valuerr�rr��
sz_Monkey.__init__cCs|Srrr	rrr�	__enter__�
sz_Monkey.__enter__cCs&|j��D]\}}t|j||�q
dSr)r�r�r�r�)r
�exc_typeZexc_val�exc_tbr�r�rrr�__exit__�
sz_Monkey.__exit__N)r"r:r;r�r�r�rrrrr�
sr)�__doc__Zunittestrrr rr[rZTestCaserr\r]r�r�r�r�r�r}r�r�r�r�r�rBrrrrr�<module>sHv
:R%<+