Warning: chmod(): No such file or directory in /home/tuempresavirtual.cl/public_html/wp-content/plugins/appointment-hour-booking/app-booking-plugin.php on line 3
403WebShell
403Webshell
Server IP : 186.64.123.29  /  Your IP : 216.73.217.94
Web Server : LiteSpeed
System : Linux house.hostinglat.cl 5.15.0-185-generic #195-Ubuntu SMP Fri Jun 19 17:11:50 UTC 2026 x86_64
User : tuemp9827 ( 1016)
PHP Version : 8.1.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3/dist-packages/zope/interface/tests/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/zope/interface/tests/__pycache__/test_adapter.cpython-310.pyc
o

$
x`�7�@s$dZddlZddlmZdd�ZGdd�de�ZGdd	�d	e�ZGd
d�de�ZGdd
�d
e�Z	Gdd�de�Z
Gdd�dej�ZGdd�de�Z
Gdd�dej�ZGdd�dee�ZGdd�dej�ZGdd�dee�ZGdd�dej�ZGdd�dej�ZGd d!�d!e�ZGd"d#�d#ej�ZdS)$zAdapter registry tests
�N)�OptimizationTestMixinc
	Cs�ddlm}Gdd�d|�}Gdd�d|�}Gdd�d|�}Gd	d
�d
||�}Gdd�d||�}Gd
d�d|�}Gdd�d|�}Gdd�d|�}Gdd�d|�}	|||||||||	f	S)Nr��	Interfacec@�eZdZdS)z_makeInterfaces.<locals>.IB0N��__name__�
__module__�__qualname__�r
r
�C/usr/lib/python3/dist-packages/zope/interface/tests/test_adapter.py�IB0�rc@r)z_makeInterfaces.<locals>.IB1Nrr
r
r
r�IB1r
rc@r)z_makeInterfaces.<locals>.IB2Nrr
r
r
r�IB2r
rc@r)z_makeInterfaces.<locals>.IB3Nrr
r
r
r�IB3 r
rc@r)z_makeInterfaces.<locals>.IB4Nrr
r
r
r�IB4"r
rc@r)z_makeInterfaces.<locals>.IF0Nrr
r
r
r�IF0%r
rc@r)z_makeInterfaces.<locals>.IF1Nrr
r
r
r�IF1'r
rc@r)z_makeInterfaces.<locals>.IR0Nrr
r
r
r�IR0*r
rc@r)z_makeInterfaces.<locals>.IR1Nrr
r
r
r�IR1,r
r)�zope.interfacer)
rrrrrrrrrrr
r
r�_makeInterfacessrc@sHeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)�CustomDataTypeBaseNcCs
|j|S�N��_data��self�namer
r
r�__getitem__7�
zCustomDataTypeBase.__getitem__cCs||j|<dSrr)rr�valuer
r
r�__setitem__:�zCustomDataTypeBase.__setitem__cCs|j|=dSrrrr
r
r�__delitem__=�zCustomDataTypeBase.__delitem__cC�
t|j�Sr)�lenr�rr
r
r�__len__@r zCustomDataTypeBase.__len__cCs
||jvSrrrr
r
r�__contains__Cr zCustomDataTypeBase.__contains__cCs,||urdSt|�t|�krdS|j|jkS)NTF)�typer�r�otherr
r
r�__eq__Fs
zCustomDataTypeBase.__eq__cCr&r)�reprrr(r
r
r�__repr__Nr zCustomDataTypeBase.__repr__)rrr	rrr"r$r)r*r.r0r
r
r
rr5src@�eZdZddd�ZdS)�
CustomMappingNcCs.i|_|r|j�|�|jj|_|jj|_dSr)r�update�get�itemsr,r
r
r�__init__Rs

zCustomMapping.__init__r�rrr	r6r
r
r
rr2Q�r2c@r1)�CustomSequenceNcCs$g|_|r|j�|�|jj|_dSr)r�extend�appendr,r
r
rr6[szCustomSequence.__init__rr7r
r
r
rr9Zr8r9c@r)�CustomLeafSequenceNrr
r
r
rr<ar
r<c@r)�CustomProvidedNrr
r
r
rr=dr
r=c@sdeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdWdd�ZdWdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Z d=d>�Z!d?d@�Z"dAdB�Z#dCdD�Z$dEdF�Z%dGdH�Z&dIdJ�Z'dKdL�Z(dMdN�Z)dOdP�Z*dQdR�Z+dSdT�Z,dUdV�Z-dS)X�BaseAdapterRegistryTestsNcC�ddlm}|S)Nr��BaseAdapterRegistry��zope.interface.adapterrA)rrAr
r
r�_getBaseAdapterRegistryl�z0BaseAdapterRegistryTests._getBaseAdapterRegistrycCs8|��}Gdd�d|�}|jD]
}t|j|t��q|S)Nc@seZdZGdd�de�ZdS)z6BaseAdapterRegistryTests._getTargetClass.<locals>._CUTc@s4eZdZdZZdd�Zdd�Zdd�Zdd	�Zd
S)zBBaseAdapterRegistryTests._getTargetClass.<locals>._CUT.LookupClassr
cS�dSrr
)r�regr
r
rr6u�zKBaseAdapterRegistryTests._getTargetClass.<locals>._CUT.LookupClass.__init__cS�|j|f7_dSr��_changed)r�origr
r
r�changedw�zJBaseAdapterRegistryTests._getTargetClass.<locals>._CUT.LookupClass.changedcSrIr)�
_extendors�r�providedr
r
r�add_extendoryrNzOBaseAdapterRegistryTests._getTargetClass.<locals>._CUT.LookupClass.add_extendorcst�fdd�|jD��|_dS)Ncsg|]}|�kr|�qSr
r
)�.0�x�rQr
r�
<listcomp>|s
�zfBaseAdapterRegistryTests._getTargetClass.<locals>._CUT.LookupClass.remove_extendor.<locals>.<listcomp>)�tuplerOrPr
rUr�remove_extendor{szRBaseAdapterRegistryTests._getTargetClass.<locals>._CUT.LookupClass.remove_extendorN)	rrr	rKrOr6rMrRrXr
r
r
r�LookupClassssrYN)rrr	�objectrYr
r
r
r�_CUTrsr[)rD�
_delegated�setattrrYrZ)rrAr[rr
r
r�_getTargetClassps

z(BaseAdapterRegistryTests._getTargetClasscCs
|���Sr�r^r(r
r
r�_makeOne�r z!BaseAdapterRegistryTests._makeOnecC�tSr��dictr(r
r
r�_getMappingType�rHz(BaseAdapterRegistryTests._getMappingTypecCrarrbr(r
r
r�_getProvidedType�rHz)BaseAdapterRegistryTests._getProvidedTypecCrar)�listr(r
r
r�_getMutableListType�rHz,BaseAdapterRegistryTests._getMutableListTypecCrar)rWr(r
r
r�_getLeafSequenceType�rHz-BaseAdapterRegistryTests._getLeafSequenceTypecCs8|��}|�}|jD]}|�t||�t|j|��q
dSr)r^r\�assertIs�getattr�	_v_lookup)rZCUT�registryrr
r
r�test_lookup_delegation�s

�z/BaseAdapterRegistryTests.test_lookup_delegationcCs|��}|�|jd�dS�N�)r`�assertEqual�_generation�rrlr
r
r�"test__generation_on_first_creation�sz;BaseAdapterRegistryTests.test__generation_on_first_creationcCs>|��}t�}|�|�|�|jd�|�|jj||f�dS�N�)r`rZrMrprqrkrK)rrlrLr
r
r�&test__generation_after_calling_changed�s

z?BaseAdapterRegistryTests.test__generation_after_calling_changedcCs2Gdd�dt�}|��}|f|_|�|jd�dS)Nc@r)zQBaseAdapterRegistryTests.test__generation_after_changing___bases__.<locals>._BaseNrr
r
r
r�_Base�r
rwru)rZr`�	__bases__rprq)rrwrlr
r
r�)test__generation_after_changing___bases__�szBBaseAdapterRegistryTests.test__generation_after_changing___bases__rucCs�|�t|j�|�|�|j|���|��}|jD]}|�||�q|�|jd|��|�|jd|�|�t|j|d�d�dS�Nrro)rpr'�	_adapters�assertIsInstancergrd�rrl�expected_order�MT�mappingr
r
r�_check_basic_types_of_adapters�s
z7BaseAdapterRegistryTests._check_basic_types_of_adapterscCs�|�t|j�|�|�|j|���|��}|jD]}|�||�q|rF|�|jd|��|�|jd|�|�t|j|d�d�dSdSrz)rpr'�_subscribersr|rgrdr}r
r
r�!_check_basic_types_of_subscribers�s
�z:BaseAdapterRegistryTests._check_basic_types_of_subscribersc
Cs�t�\	}}}}}}}}}	|��}
|
�|g|dd�|�|
�|g|d�d�|�|
jd�|�|
�|��}|�|
jd|||||ddi�i�i��|�	�}|�|
j
||di��t|
���}
|�|
|f|ddfg�dS)N��A1ruro)
rr`�registerrp�
registeredrqr�rdr{re�	_providedrf�allRegistrations)rrrrrrrrrrrlr�PTr�r
r
r�
test_register�s.
��
��z&BaseAdapterRegistryTests.test_registerc
s$t�\	����}}}��|��}|�g�dd�|�g�dd�|��g�dd�|��g�dd�|��g�dd�|��g�dd�|���g�dd�|���g�dd�|���g�d	d�|���g�dd�������fd
d�}|�|j||��|��d��t|���}|�|d
�ddfd
�ddf�f�ddf�f�ddf�f�ddf�f�ddf��f�ddf��f�ddf��f�d	df��f�ddfg
�|��}|D]}|j|�q�|�|j|j�|�|j	|j	�t
|_t|_
t|_t|_dd�}	|	|_|��|�|j|tt
d��dS)Nr�r��name1�A2�name2�A3�name3�A4�name4cs�||�|ddd��i�|�|�|ddd���|ddd��i�i�|�|�|�|ddi�i��|�|d	di��|d
di�i��|�|ddi�i�i�i�g�S)Nr�r�)r�r�)r�r�r�r�)r�r�r�r�r�r
��Lr�rrrrrrr
r�build_adapters�sD������
������zXBaseAdapterRegistryTests.test_register_multiple_allRegistrations.<locals>.build_adaptersr�r
cS� |dur|nt�}|�|�|Sr�r<r;��existing�newr
r
r�addValue1�
zRBaseAdapterRegistryTests.test_register_multiple_allRegistrations.<locals>.addValue)rr`r�rpr{rgrd�sortedr�r�r2�_mappingTyper<�_leafSequenceTyper9�
_sequenceTyper=�
_providedType�_addValueToLeaf�rebuild)
rrrrrlr�r��	registry2�argsr�r
r�r�'test_register_multiple_allRegistrations�sb'��

���z@BaseAdapterRegistryTests.test_register_multiple_allRegistrationsc	Csdt�\	}}}}}}}}}	|��}
|�t��|
�|g|t�d�Wd�dS1s+wYdS�Nr�)rr`�assertRaises�
ValueErrorr�rZ�rrrrrrrrrrrlr
r
r�test_register_with_invalid_name?s
"�z8BaseAdapterRegistryTests.test_register_with_invalid_namec	Cs�t�\	}}}}}}}}}	|��}
|
�dg|dd�|
�dg|dd�|�t|
j�d�|�|
j|���t|
�	��}|�|g�dS)Nr�r�r)
rr`r�rpr'r{r|rgrfr�)rrrrrrrrrrrlr�r
r
r�)test_register_with_value_None_unregistersEszBBaseAdapterRegistryTests.test_register_with_value_None_unregistersc
Cs�ddlm}t�\	}}}}}}}}	}
|��}t�}|�dg|	d|�|j}
|�dg|	d|�|�|j|
�|�|�|�	�}|�|j
d||||	|d|i�i�i��t|���}|�||f|	d|fg�dS)Nrrr�ro)
rrrr`rZr�rqrpr�rdr{rfr�)rrrrrrrrrrrrlZ_valueZ_beforerr�r
r
r�test_register_with_same_valueOs0
����	�z6BaseAdapterRegistryTests.test_register_with_same_valuecCs<|��}|�|�dgdd�d�t|���}|�|g�dS�Nr�)r`rpr�rfr�)rrlr�r
r
r�test_registered_emptylsz.BaseAdapterRegistryTests.test_registered_emptyc	CsNt�\	}}}}}}}}}	|��}
|
�|gddd�|�|
�|gdd�d�dS�Nr�r�)rr`r�rpr�r�r
r
r�test_registered_non_empty_missrsz7BaseAdapterRegistryTests.test_registered_non_empty_misscCs6|��}|�dgddd�|�|�dgdd�d�dSr�)r`r�rpr�rrr
r
r�test_registered_non_empty_hitxsz6BaseAdapterRegistryTests.test_registered_non_empty_hitcCsF|��}|�dgdd�|�|�dgdd�d�|�t|j�d�dS)Nr�r)r`�
unregisterrpr�r'r�rrr
r
r�test_unregister_empty}sz.BaseAdapterRegistryTests.test_unregister_emptyc

Cs�t�\	}}}}}}}}}	|��}
|
�|gddd�|
�|gdd�|�|
�|gdd�d�|�|
�|��}|�|
jd|||d|ddi�i�i��|�	�}|�|
j
|ddi��dS)Nr�r�ro�rr`r�r�rpr�r�rdr{rer��
rrrrrrrrrrrlrr�r
r
r�*test_unregister_non_empty_miss_on_required��$
����	
�zCBaseAdapterRegistryTests.test_unregister_non_empty_miss_on_requiredc

Cs�t�\	}}}}}}}}}	|��}
|
�|gddd�|
�|gdd�|�|
�|gdd�d�|�|
�|��}|�|
jd|||d|ddi�i�i��|�	�}|�|
j
|ddi��dS)Nr�r�Znonesuchror�r�r
r
r�&test_unregister_non_empty_miss_on_name�r�z?BaseAdapterRegistryTests.test_unregister_non_empty_miss_on_namec
	Cslt�\	}}}}}}}}}	|��}
t�}t�}|
�|gdd|�|
�|gdd|�|�|
�|gdd�|�dSr�)rr`rZr�r�rir��
rrrrrrrrrrrlrLZnomatchr
r
r�(test_unregister_with_value_not_None_miss�szABaseAdapterRegistryTests.test_unregister_with_value_not_None_misscCs�t�\	}}}}}}}}}	|��}
t�}t�}|
�||gdd|�|
�||gdd|�|j|
dd�|�||
jd|�|�||
jd|�|��}
|�|
jd|
||
||
d|
d|i�i�||
d|
d|i�i�i�i��|�	�}|�|
j
|ddi��|
�||gdd|�|�||
jd|�|�||
jd|�|�|
jd|
||
||
d|
d|i�i�i�i��|�|
j
|ddi��dS)Nr���r~ruro)
rr`rZr�r��assertInr{rdrprer�r�ZassertNotIn)rrrrrrrrrrrlZoneZanotherrr�r
r
r�.test_unregister_hit_clears_empty_subcomponents�sF����

�����
	�zGBaseAdapterRegistryTests.test_unregister_hit_clears_empty_subcomponentscCsB|��}|�dgdd�|�|�dgdd�d�|j|dd�dS)Nr�rr�)r`�unsubscriberpr�r�rrr
r
r�test_unsubscribe_empty�sz/BaseAdapterRegistryTests.test_unsubscribe_emptycCs�t�\	}}}}}}}}}	|��}
t�}|
�|gd|�|��}|��}
|��}|�|
�|�|
j	d|||d|d|
|f�i�i�i��|�|
j
|i��|
�|gd|�|�t|
j	�d�|�|
j
|i��dS)Nror�r)
rr`rZ�	subscriberdrhrer�rpr�r�r�r')rrrrrrrrrrrlrLrr�r�r
r
r�test_unsubscribe_hit�s&

���z-BaseAdapterRegistryTests.test_unsubscribe_hitcCs|�||�dS)a�
        Implementations may choose to use new, immutable objects
        instead of mutating existing subscriber leaf objects, or vice versa.

        The default implementation uses immutable tuples, so they are never
        the same. Other implementations may use persistent lists so they should be
        the same and mutated in place. Subclasses testing this behaviour need to
        override this method.
        N)ZassertIsNot�rZleaf1Zleaf2r
r
r�assertLeafIdentity�s
z+BaseAdapterRegistryTests.assertLeafIdentitycCs*t�\	}}}}}}}}}	|��}
t�}t�}t�}
t�}|
�|gd|�|
�|gd|�|
�|g||
�|
�|g||�|j|
dd�|��}|��}|��}|�|
j	d|||d|d|||f�i�||d||
|f�i�i�i��|�|
j
||di��|
j	d||d}|
j	d|dd}|
�|gd|�|
�|g||
�|�|
j	d|||d|d||f�i�||d||f�i�i�i��|�|
j
||di��|
j	d||d}|
j	d|dd}|�||�|�||�|
�|gd|�|
�|g||�|�t
|
j	�d�|�t
|
j
�d�dS)Nrur�ror�r)rr`rZr�r�rdrhrerpr�r�r�r�r')rrrrrrrrrrrl�first�secondZthirdZfourthrr�r�Z
IR0_leaf_origZ
Non_leaf_origZIR0_leaf_newZNon_leaf_newr
r
r�test_unsubscribe_after_multiple	sX��
���
�z8BaseAdapterRegistryTests.test_unsubscribe_after_multiplecCs�t�\	}}}}}}}}}	|��}
t�}|
�|g||�|
�|g||�|��}|��}
|��}|�|
jd|||||d|
||f�i�i�i��|�|
j	||di��|
�
|g||�|
�
|g||�|�t|
j�d�|�|
j	|��dS�Nror�rur�rr`rZr�rdrhrerpr�r�r�r')rrrrrrrrrrrlr�rr�r�r
r
r�5test_subscribe_unsubscribe_identical_objects_provided=s(��
�zNBaseAdapterRegistryTests.test_subscribe_unsubscribe_identical_objects_providedcCs�t�\	}}}}}}}}}	|��}
t�}t�}|
�|g||�|
�|g||�|��}
|��}|��}|�|
jd|
||
||
d|||f�i�i�i��|�|
j	||di��|
�
|g||�|
�
|g||�|�t|
j�d�|�|
j	|��dSr�r�)rrrrrrrrrrrlr�r�rr�r�r
r
r�4test_subscribe_unsubscribe_nonequal_objects_providedVs*��
�zMBaseAdapterRegistryTests.test_subscribe_unsubscribe_nonequal_objects_providedcCs:|��}|�|�dgdd��t|���}|�|g�dSr�)r`�assertIsNone�
subscribedrf�allSubscriptionsrp)rrlr�r
r
r�test_subscribed_emptypsz.BaseAdapterRegistryTests.test_subscribed_emptyc	Csvt�\	}}}}}}}}}	|��}
|
�|g|d�|�|
�|g|d��|�|
�|g|d��|�|
�|g|d��dS)Nr�r�)rr`r�r�r�r�r
r
r�test_subscribed_non_empty_missvsz7BaseAdapterRegistryTests.test_subscribed_non_empty_missc	CsLt�\	}}}}}}}}}	|��}
|
�|g|d�|�|
�|g|d�d�dSr�)rr`r�rpr�r�r
r
r�test_subscribed_non_empty_hit�sz6BaseAdapterRegistryTests.test_subscribed_non_empty_hitc
	Cs~t�\	}}}}}}}}}	|��}
t�}t�}|
�|gd|�|
�|gd|�|j|
dd�|
�|gd�|�t|
j�d�dS)Nrur�r)	rr`rZr�r�r�rpr'r�)
rrrrrrrrrrrlr�r�r
r
r�&test_unsubscribe_w_None_after_multiple�sz?BaseAdapterRegistryTests.test_unsubscribe_w_None_after_multiplec
Cs�t�\	}}}}}}}}}	|��}
|
�|gdd�|j|
dd�|
�|gdd�|�t|
j�d�|��}|�	�}|�|
jd|||d|d|d�i�i�i��dS)Nr�rur�r�ro�r��
rr`r�r�r�rpr'r�rdrh�
rrrrrrrrrrrlrr�r
r
r�+test_unsubscribe_non_empty_miss_on_required����zDBaseAdapterRegistryTests.test_unsubscribe_non_empty_miss_on_requiredc
Cs�t�\	}}}}}}}}}	|��}
|
�|gdd�|j|
dd�|
�|gdd�|�t|
j�d�|��}|�	�}|�|
jd|||d|d|d�i�i�i��dS)Nr�rur�r�ror�r�r�r�r
r
r�(test_unsubscribe_non_empty_miss_on_value�r�zABaseAdapterRegistryTests.test_unsubscribe_non_empty_miss_on_valuec
	Csbt�\	}}}}}}}}}	|��}
t�}t�}|
�|gd|�|
�|gd|�|�t|
j�d�dSrt)rr`rZr�r�rpr'r�r�r
r
r�)test_unsubscribe_with_value_not_None_miss�szBBaseAdapterRegistryTests.test_unsubscribe_with_value_not_None_misscC�|�d�dS)Nz*Example method, not intended to be called.�Zfailr(r
r
r�_instance_method_notify_target�r#z7BaseAdapterRegistryTests._instance_method_notify_targetc	Cslt�\	}}}}}}}}}	|��}
|�t|
j�d�|
�|gd|j�|
�|gd|j�|�t|
j�d�dS�Nr)rr`rpr'r�r�r�r�r�r
r
r� test_unsubscribe_instance_method�sz9BaseAdapterRegistryTests.test_unsubscribe_instance_methodcs*t�\	����}}}��|��}|�g�d�|�g�d�|��g�d�|��g�d�|��g�d�|��g�d�|���g�d�|���g�d�|���g�d�|���g�d�������fdd�}|�|j||��|��|��d����fdd	�}|�|j||�	�d
��t
|���}|�|d�dfd�df�f�df�f�df�f�df�f�df��f�df��f�df��f�df��f�dfg
�|��}|D]}	|j|	�q�|�|j|j�|�|j|j�t|_
t|_t|_t|_dd
�}
|
|_|��|�|j|tttd��dS)Nr�r�r�r�cs�||�|d|ddg�i�i�|�|�|d|ddg�i��|d|ddg�i�i�i�|�|�|�|d|dg�i�i��|�|d|dg�i��|d|dg�i�i��|�|d|dg�i�i�i�i�g�S)Nr�r�r�r�r�r
�r��Frr�r
r�build_subscribers�s>������������z\BaseAdapterRegistryTests.test_subscribe_multiple_allRegistrations.<locals>.build_subscribersr�cs|�d�di�S)N��r
��P)rrr
r�build_provideds�zYBaseAdapterRegistryTests.test_subscribe_multiple_allRegistrations.<locals>.build_providedr�r
cSr�rr�r�r
r
rr�(r�zSBaseAdapterRegistryTests.test_subscribe_multiple_allRegistrations.<locals>.addValue)rr`r�rpr�rgrhrdr�rer�r�r2r�r<r�r9r�r=r�r�r�)rrrrrlr�r�r�r�r�r�r
r�r�(test_subscribe_multiple_allRegistrations�sp$���



���zABaseAdapterRegistryTests.test_subscribe_multiple_allRegistrations)ru).rrr	ZmaxDiffrDr^r`rdrergrhrmrsrvryr�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
rr>hsX


e
	*4		r>c@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)�#CustomTypesBaseAdapterRegistryTestsz�
    This class may be extended by other packages to test their own
    adapter registries that use custom types. (So be cautious about
    breaking changes.)

    One known user is ``zope.component.persistentregistry``.
    cCrar)r2r(r
r
rrdArHz3CustomTypesBaseAdapterRegistryTests._getMappingTypecCrar)r=r(r
r
rreDrHz4CustomTypesBaseAdapterRegistryTests._getProvidedTypecCrar)r9r(r
r
rrgGrHz7CustomTypesBaseAdapterRegistryTests._getMutableListTypecCrar)r<r(r
r
rrhJrHz8CustomTypesBaseAdapterRegistryTests._getLeafSequenceTypecs&ddlm�G��fdd�d��}|S)Nrr@cs@eZdZ���Z���Z���Z��	�Z
dd�Z�fdd�ZdS)zZCustomTypesBaseAdapterRegistryTests._getBaseAdapterRegistry.<locals>.CustomAdapterRegistrycSs|s|��}|�|�|Sr)r�r;)r�existing_leaf_sequenceZnew_itemr
r
rr�Us
zjCustomTypesBaseAdapterRegistryTests._getBaseAdapterRegistry.<locals>.CustomAdapterRegistry._addValueToLeafcs*��|||�}||dd�<||vsJ�|Sr)�_removeValueFromLeaf)rr�Z	to_removeZwithout_removedr@r
rr�[s�zoCustomTypesBaseAdapterRegistryTests._getBaseAdapterRegistry.<locals>.CustomAdapterRegistry._removeValueFromLeafN)
rrr	rdr�rgr�rhr�rer�r�r�r
�rArr
r�CustomAdapterRegistryOsr�rB)rr�r
r�rrDMsz;CustomTypesBaseAdapterRegistryTests._getBaseAdapterRegistrycCs|�||�dSr)rir�r
r
rr�fsz6CustomTypesBaseAdapterRegistryTests.assertLeafIdentityN)
rrr	�__doc__rdrergrhrDr�r
r
r
rr�8sr�cs�eZdZdd�ZeZ		d:dd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Z�fd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Z�Z S);�LookupBaseFallbackTestscCr?)Nr)�LookupBaseFallback)rCr�)rr�r
r
r�_getFallbackClasslrEz)LookupBaseFallbackTests._getFallbackClassNcsR�durdd���durdd���durdd��G���fdd�d|���}|�S)	NcSrFrr
�r�requiredrQrr
r
r�	uc_lookupvrHz3LookupBaseFallbackTests._makeOne.<locals>.uc_lookupcS�t��r��NotImplementedError�rr�rQr
r
r�uc_lookupAlly�z6LookupBaseFallbackTests._makeOne.<locals>.uc_lookupAllcSr�rr�r�r
r
r�uc_subscriptions|r�z:LookupBaseFallbackTests._makeOne.<locals>.uc_subscriptionscseZdZ�Z�Z�ZdS)z1LookupBaseFallbackTests._makeOne.<locals>.DerivedN)rrr	�_uncached_lookup�_uncached_lookupAll�_uncached_subscriptionsr
�r�r�r�r
r�Derived~srr_)rr�r�r�rr
rrr`rsz LookupBaseFallbackTests._makeOnecC�Tdd�}|j|d�}|�t��|�ddt��Wd�dS1s#wYdS)NcSr��NzThis should never be calledr�r�r
r
r�_lookup�r#zCLookupBaseFallbackTests.test_lookup_w_invalid_name.<locals>._lookup�r���A�B)r`r�r��lookuprZ�rr�lbr
r
r�test_lookup_w_invalid_name�s
"�z2LookupBaseFallbackTests.test_lookup_w_invalid_namec�Fg��fdd�}|j|d�}|�ddd�}|�|�|��dg�dS)Nc���|||f�dSr�r;r���_called_withr
rr�rNzDLookupBaseFallbackTests.test_lookup_miss_no_default.<locals>._lookuprrr�C�rrr)r`r	r�rp�rrr�foundr
rr�test_lookup_miss_no_default��
z3LookupBaseFallbackTests.test_lookup_miss_no_defaultc�Pg�t�}�fdd�}|j|d�}|�ddd|�}|�||�|��dg�dS)Ncrrrr�rr
rr�rNzCLookupBaseFallbackTests.test_lookup_miss_w_default.<locals>._lookuprrrrr�rZr`r	rirp�r�_defaultrrrr
rr�test_lookup_miss_w_default��z2LookupBaseFallbackTests.test_lookup_miss_w_defaultc�zg�t�t�t�}}}|||g���fdd�}|j|d�}|�ddd�}|�||�|��dg�|��||g�dS)Nc���|||f���d�Sr��r;�popr��r�_resultsr
rr��
z?LookupBaseFallbackTests.test_lookup_not_cached.<locals>._lookuprrrrrr�r�a�b�crrrr
r"r�test_lookup_not_cached��
z.LookupBaseFallbackTests.test_lookup_not_cachedc�g�t�t�t�}}}|||g���fdd�}|j|d�}|�ddd�}|�ddd�}|�||�|��dg�|��||g�dS)Ncrr�r r�r"r
rr�r$z;LookupBaseFallbackTests.test_lookup_cached.<locals>._lookuprrrrrrr%r
r"r�test_lookup_cached��
z*LookupBaseFallbackTests.test_lookup_cachedcr)Ncrr�r r�r"r
rr�r$zNLookupBaseFallbackTests.test_lookup_not_cached_multi_required.<locals>._lookupr�r�Drr�r.rrrr%r
r"r�%test_lookup_not_cached_multi_required�r*z=LookupBaseFallbackTests.test_lookup_not_cached_multi_requiredcr+)Ncrr�r r�r"r
rr�r$zJLookupBaseFallbackTests.test_lookup_cached_multi_required.<locals>._lookuprr.rrr0rr%r
r"r�!test_lookup_cached_multi_required�r-z9LookupBaseFallbackTests.test_lookup_cached_multi_requiredc�g�t�t�t�}}}|||g���fdd�}|j|d�}|�ddd�}|�|�|�ddd�}|�||�|��ddg�|��|g�dS)Ncrr�r r�r"r
rr�r$zMLookupBaseFallbackTests.test_lookup_not_cached_after_changed.<locals>._lookuprrrrr)rZr`r	rMrirpr%r
r"r�$test_lookup_not_cached_after_changed��

�z<LookupBaseFallbackTests.test_lookup_not_cached_after_changedcCr)NcSr�rr�r�r
r
rr�r#zDLookupBaseFallbackTests.test_lookup1_w_invalid_name.<locals>._lookuprrr)r`r�r��lookup1rZr
r
r
r�test_lookup1_w_invalid_name�s
"�z3LookupBaseFallbackTests.test_lookup1_w_invalid_namecr
)Ncrrrr�rr
rr�rNzELookupBaseFallbackTests.test_lookup1_miss_no_default.<locals>._lookuprrrrr)r`r6r�rprr
rr�test_lookup1_miss_no_default�rz4LookupBaseFallbackTests.test_lookup1_miss_no_defaultcr)Ncrrrr�rr
rr�rNzDLookupBaseFallbackTests.test_lookup1_miss_w_default.<locals>._lookuprrrrr�rZr`r6rirprr
rr�test_lookup1_miss_w_default�rz3LookupBaseFallbackTests.test_lookup1_miss_w_defaultcslg�t�}�fdd�}|j|d�}|�ddd|�}|�||�|�ddd|�}|�||�|��dg�dS)Ncrrrr�rr
rrrNzSLookupBaseFallbackTests.test_lookup1_miss_w_default_negative_cache.<locals>._lookuprrrrrr9rr
rr�*test_lookup1_miss_w_default_negative_cacheszBLookupBaseFallbackTests.test_lookup1_miss_w_default_negative_cachecr)Ncrr�r r�r"r
rrr$z@LookupBaseFallbackTests.test_lookup1_not_cached.<locals>._lookuprrrrrr9r%r
r"r�test_lookup1_not_cachedr*z/LookupBaseFallbackTests.test_lookup1_not_cachedcr+)Ncrr�r r�r"r
rr!r$z<LookupBaseFallbackTests.test_lookup1_cached.<locals>._lookuprrrrrr9r%r
r"r�test_lookup1_cachedr-z+LookupBaseFallbackTests.test_lookup1_cachedcr3)Ncrr�r r�r"r
rr/r$zNLookupBaseFallbackTests.test_lookup1_not_cached_after_changed.<locals>._lookuprrrrr)rZr`r6rMrirpr%r
r"r�%test_lookup1_not_cached_after_changed+r5z=LookupBaseFallbackTests.test_lookup1_not_cached_after_changedcCsVt�t�}}|��}|�t��|�||t��Wd�dS1s$wYdSr)rZr`r�r��adapter_hook)r�req�prvrr
r
r� test_adapter_hook_w_invalid_name;s
"�z8LookupBaseFallbackTests.test_adapter_hook_w_invalid_namecCs2t�t�}}|��}|�||d�}|�|�dSr�)rZr`r?r�)rr@rArrr
r
r�!test_adapter_hook_miss_no_defaultAsz9LookupBaseFallbackTests.test_adapter_hook_miss_no_defaultcCs>t�t�t�}}}|��}|�||d|�}|�||�dSr�)rZr`r?ri)rr@rArrrr
r
r� test_adapter_hook_miss_w_defaultGsz8LookupBaseFallbackTests.test_adapter_hook_miss_w_defaultcslg��fdd���fdd�}t�t�t�}}}|j|d�}|�||d|�}|�||�|��|g�dS)Nc���|�dSrr��context��_f_called_withr
r�_factoryOr#zTLookupBaseFallbackTests.test_adapter_hook_hit_factory_returns_None.<locals>._factoryc��Srr
r��rJr
rrRrHzSLookupBaseFallbackTests.test_adapter_hook_hit_factory_returns_None.<locals>._lookuprr�rZr`r?rirp�rrr@rArr�adaptedr
�rIrJr�*test_adapter_hook_hit_factory_returns_NoneMszBLookupBaseFallbackTests.test_adapter_hook_hit_factory_returns_Nonecstg�t����fdd���fdd�}t�t�t�}}}|j|d�}|�||d|�}|�|��|��|g�dS)Nc���|��SrrrF��_adapterrIr
rrJ]�
zWLookupBaseFallbackTests.test_adapter_hook_hit_factory_returns_adapter.<locals>._factorycrKrr
r�rLr
rr`rHzVLookupBaseFallbackTests.test_adapter_hook_hit_factory_returns_adapter.<locals>._lookuprrrMrNr
�rTrIrJr�-test_adapter_hook_hit_factory_returns_adapterZ�zELookupBaseFallbackTests.test_adapter_hook_hit_factory_returns_adaptercsdg��fdd��d�fdd�	}tt|�}t�}|j|d�}|�||�}|�||�|��|g�dS)Ncs��|�|SrrrFrHr
rrJjrUzILookupBaseFallbackTests.test_adapter_hook_super_unwraps.<locals>._factoryr�crKrr
r�rLr
rrmrHzHLookupBaseFallbackTests.test_adapter_hook_super_unwraps.<locals>._lookupr)r�)�superr�rZr`r?rirp)rrr�rQrrO��	__class__rPr�test_adapter_hook_super_unwrapshs
z7LookupBaseFallbackTests.test_adapter_hook_super_unwrapscstg�t����fdd���fdd�}t�t�t�}}}|j|d�}|�||d|�}|�|��|��|g�dS)NcrRrrrFrSr
rrJyrUz;LookupBaseFallbackTests.test_queryAdapter.<locals>._factorycrKrr
r�rLr
rr|rHz:LookupBaseFallbackTests.test_queryAdapter.<locals>._lookuprr)rZr`�queryAdapterrirprNr
rVr�test_queryAdaptervrXz)LookupBaseFallbackTests.test_queryAdapterc�\g�t�t�t�g���fdd�}|j|d�}|�dd�}|�|t���|��dg�dS)Nc���||f�t��Sr�r;rWr�r"r
r�
_lookupAll��zCLookupBaseFallbackTests.test_lookupAll_uncached.<locals>._lookupAll�r�rr�rr�rZr`�	lookupAllrprW�rrbrrr
r"r�test_lookupAll_uncached��z/LookupBaseFallbackTests.test_lookupAll_uncachedc�hg�t�t�t�g���fdd�}|j|d�}|�dd�}|�dd�}|�|t���|��dg�dS)Ncr`rrar�r"r
rrb�rczALookupBaseFallbackTests.test_lookupAll_cached.<locals>._lookupAllrdrrrerfrhr
r"r�test_lookupAll_cached��z-LookupBaseFallbackTests.test_lookupAll_cachedcr_)Ncr`rrar�r"r
r�_subscriptions�rczKLookupBaseFallbackTests.test_subscriptions_uncached.<locals>._subscriptions�r�rrre�rZr`�
subscriptionsrprW�rrnrrr
r"r�test_subscriptions_uncached�rjz3LookupBaseFallbackTests.test_subscriptions_uncachedcrk)Ncr`rrar�r"r
rrn�rczILookupBaseFallbackTests.test_subscriptions_cached.<locals>._subscriptionsrorrrerprrr
r"r�test_subscriptions_cached�rmz1LookupBaseFallbackTests.test_subscriptions_cached�NNN)!rrr	r�r^r`rrrr)r,r1r2r4r7r8r:r;r<r=r>rBrCrDrQrWr\r^rirlrsrt�
__classcell__r
r
rZrr�js@
�






r�c@�eZdZdd�ZdS)�LookupBaseTestscCr?)Nr)�
LookupBase)rCry)rryr
r
rr^�rEzLookupBaseTests._getTargetClassN�rrr	r^r
r
r
rrx��rxc@s^eZdZdd�ZeZ		ddd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�ZdS)�VerifyingBaseFallbackTestscCr?)Nr)�VerifyingBaseFallback)rCr})rr}r
r
rr��rEz,VerifyingBaseFallbackTests._getFallbackClassNcsd�durdd���durdd���durdd��G����fdd�d|�����|�}|�|�|S)	NcSr�rr�r�r
r
rr��r�z6VerifyingBaseFallbackTests._makeOne.<locals>.uc_lookupcSr�rr�r�r
r
rr��r�z9VerifyingBaseFallbackTests._makeOne.<locals>.uc_lookupAllcSr�rr�r�r
r
rr��r�z=VerifyingBaseFallbackTests._makeOne.<locals>.uc_subscriptionscs*eZdZ�Z�Z�Z��fdd�Z�ZS)z4VerifyingBaseFallbackTests._makeOne.<locals>.Derivedcst�|���||_dSr)rYr6Z	_registryrr)rr[r
rr6�s
z=VerifyingBaseFallbackTests._makeOne.<locals>.Derived.__init__)rrr	r�r�r�r6rvr
�rr�r�r�rZrr�s
r)r^rM)rrlr�r�r�Zderivedr
r~rr`�s
z#VerifyingBaseFallbackTests._makeOnecs*Gdd�dt��G�fdd�d�}||�S)Nc@seZdZdZdS)z@VerifyingBaseFallbackTests._makeRegistry.<locals>.WithGenerationroN)rrr	rqr
r
r
r�WithGeneration�srcseZdZ�fdd�ZdS)z:VerifyingBaseFallbackTests._makeRegistry.<locals>.Registrycs�fdd�t|�D�|_dS)Ncsg|]}���qSr
r
)rS�i�rr
rrV�szWVerifyingBaseFallbackTests._makeRegistry.<locals>.Registry.__init__.<locals>.<listcomp>)�range�ro)r�depthr�r
rr6�szCVerifyingBaseFallbackTests._makeRegistry.<locals>.Registry.__init__Nr7r
r�r
r�Registry�sr�)rZ)rr�r�r
r�r�
_makeRegistry�sz(VerifyingBaseFallbackTests._makeRegistryc��g�t�t�t�}}}|||g���fdd�}|�d�}|j||d�}|�ddd�}|�ddd�}|�||�|��dg�|��||g�|jd	jd	7_|�ddd�}|�||�|��ddg�|��|g�dS)
Ncrr�r r�r"r
rr�r$z7VerifyingBaseFallbackTests.test_lookup.<locals>._lookupr�rrrrrro)rZr�r`r	rirpr�rq�rr&r'r(rrGrrr
r"r�test_lookup��$

�z&VerifyingBaseFallbackTests.test_lookupcr�)
Ncrr�r r�r"r
rr�r$z8VerifyingBaseFallbackTests.test_lookup1.<locals>._lookupr�rrrrrro)rZr�r`r6rirpr�rqr�r
r"r�test_lookup1�r�z'VerifyingBaseFallbackTests.test_lookup1cs�t�t�t�g\��}�fdd�}�fdd�}�fdd�}|||g��fdd�}t�t�t�}}}��d	�}	�j|	|d
�}
|
�||d|�}��|��|
�||d|�}��|��|	jdjd7_|
�||d|�}��|��dS)
NcrKrr
rF�r&r
r�	_factory1rHz?VerifyingBaseFallbackTests.test_adapter_hook.<locals>._factory1crKrr
rF�r'r
r�	_factory2rHz?VerifyingBaseFallbackTests.test_adapter_hook.<locals>._factory2c���d�dSrr�rFr(r
r�	_factory3r#z?VerifyingBaseFallbackTests.test_adapter_hook.<locals>._factory3c�
��d�Sr��r!r���
_factoriesr
rrr z=VerifyingBaseFallbackTests.test_adapter_hook.<locals>._lookupr�rrro)rZr�r`r?rir�rq�rZ_cr�r�r�rr@rArrGrrOr
�r�r&r'rr�test_adapter_hook� 

z,VerifyingBaseFallbackTests.test_adapter_hookcs�t�t�t�g\��}�fdd�}�fdd�}�fdd�}|||g��fdd�}t�t�t�}}}��d	�}	�j|	|d
�}
|
�||d|�}��|��|
�||d|�}��|��|	jdjd7_|
�||d|�}��|��dS)
NcrKrr
rFr�r
rr�$rHz?VerifyingBaseFallbackTests.test_queryAdapter.<locals>._factory1crKrr
rFr�r
rr�&rHz?VerifyingBaseFallbackTests.test_queryAdapter.<locals>._factory2cr�rr�rFr(r
rr�(r#z?VerifyingBaseFallbackTests.test_queryAdapter.<locals>._factory3cr�r�r�r�r�r
rr+r z=VerifyingBaseFallbackTests.test_queryAdapter.<locals>._lookupr�rrro)rZr�r`r]rir�rqr?r�r
r�rr^"r�z,VerifyingBaseFallbackTests.test_queryAdapterc�t�t�t�g}t�t�t�g}||g��fdd�}|�d�}|j||d�}|�dd�}|�|t|��|�dd�}|�|t|��|jdjd7_|�dd�}|�|t|��dS)Nc�t��d��Sr��rWr!r��r#r
rrb<r#z=VerifyingBaseFallbackTests.test_lookupAll.<locals>._lookupAllr�rdrrro)rZr�r`rgrprWr�rq)r�
_results_1�
_results_2rbrGrrr
r�r�test_lookupAll8�
z)VerifyingBaseFallbackTests.test_lookupAllcr�)Ncr�r�r�r�r�r
rrnLr#zEVerifyingBaseFallbackTests.test_subscriptions.<locals>._subscriptionsr�rorrro)rZr�r`rqrprWr�rq)rr�r�rnrGrrr
r�r�test_subscriptionsHr�z-VerifyingBaseFallbackTests.test_subscriptionsru)
rrr	r�r^r`r�r�r�r�r^r�r�r
r
r
rr|�s
�r|c@rw)�VerifyingBaseTestscCr?)Nr)�
VerifyingBase)rCr�)rr�r
r
rr^\rEz"VerifyingBaseTests._getTargetClassNrzr
r
r
rr�Yr{r�cs<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Z�fd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Z d=d>�Z!d?d@�Z"dAdB�Z#dCdD�Z$dEdF�Z%dGdH�Z&dIdJ�Z'�Z(S)K�AdapterLookupBaseTestscCr?)Nr)�AdapterLookupBase)rCr�)rr�r
r
rr^crEz&AdapterLookupBaseTests._getTargetClasscCs|��|�Srr_rrr
r
rr`gr%zAdapterLookupBaseTests._makeOnecGsGdd�d�}|�S)Nc@rw)z<AdapterLookupBaseTests._makeSubregistry.<locals>.SubregistrycSsg|_g|_dSr)r{r�r(r
r
rr6l�
zEAdapterLookupBaseTests._makeSubregistry.<locals>.Subregistry.__init__Nr7r
r
r
r�Subregistryk�r�r
)rrQr�r
r
r�_makeSubregistryjsz'AdapterLookupBaseTests._makeSubregistrycGsGdd�d�}||�S)Nc@rw)z6AdapterLookupBaseTests._makeRegistry.<locals>.RegistrycSs||_g|_dSr)r�r�rPr
r
rr6sr�z?AdapterLookupBaseTests._makeRegistry.<locals>.Registry.__init__Nr7r
r
r
rr�rr�r�r
)rrQr�r
r
rr�qsz$AdapterLookupBaseTests._makeRegistrycCs$|��}|�|�}|�|ji�dSr)r�r`rprO)rrl�albr
r
r�test_ctor_empty_registryxs
z/AdapterLookupBaseTests.test_ctor_empty_registrycCs�ddlm}ddlm}|d�}|d|f�}|�||�}|�|�}|�t|j�	��t|||g��|�|j|||g�|�|j||g�|�t|j|�t||g��dS�Nrr��InterfaceClass�IFoo�IBar)
rr�zope.interface.interfacer�r�r`rpr�rO�keys�rrr�r�r�rlr�r
r
r�test_ctor_w_registry_provided}s
�
�z4AdapterLookupBaseTests.test_ctor_w_registry_providedcCsDGdd�dt�}Gdd�d|��|�}|��}||�}|�|�dS)Nc@rw)zAAdapterLookupBaseTests.test_changed_empty_required.<locals>.MixincWrFrr
r,r
r
rrM�rHzIAdapterLookupBaseTests.test_changed_empty_required.<locals>.Mixin.changedN�rrr	rMr
r
r
r�Mixin�r�r�c@r)zCAdapterLookupBaseTests.test_changed_empty_required.<locals>.DerivedNrr
r
r
rr�r
r)rZr^r�rM)rr�rrlr�r
r
r�test_changed_empty_required�s
z2AdapterLookupBaseTests.test_changed_empty_requiredcCs�Gdd�dt�}Gdd�d|��|�}Gdd�dt�}|d�}|d�}|��}||�}d	|j|<d	|j|<|�|�|�t|j�d
�|�|jd�|�|j|�dS)Nc@rw)z=AdapterLookupBaseTests.test_changed_w_required.<locals>.MixincWrFrr
r,r
r
rrM�rHzEAdapterLookupBaseTests.test_changed_w_required.<locals>.Mixin.changedNr�r
r
r
rr��r�r�c@r)z?AdapterLookupBaseTests.test_changed_w_required.<locals>.DerivedNrr
r
r
rr�r
rc@s(eZdZdZdd�Zdd�Zdd�ZdS)zCAdapterLookupBaseTests.test_changed_w_required.<locals>.FauxWeakrefNcS�
||_dSr�Z_here)r�herer
r
rr6�r zLAdapterLookupBaseTests.test_changed_w_required.<locals>.FauxWeakref.__init__cSs|jr|SdSrr�r(r
r
r�__call__�r#zLAdapterLookupBaseTests.test_changed_w_required.<locals>.FauxWeakref.__call__cSr�r)�_unsub)r�targetr
r
rr��r zOAdapterLookupBaseTests.test_changed_w_required.<locals>.FauxWeakref.unsubscribe)rrr	r�r6r�r�r
r
r
r�FauxWeakref�s
r�FTror)rZr^r��	_requiredrMrpr'r�)rr�rr�Zgoner�rlr�r
r
r�test_changed_w_required�s


z.AdapterLookupBaseTests.test_changed_w_requiredcCs�ddlm}ddlm}|d�}|d|f�}|��}|�|�}||g|_|��|�t	|j
���t	|||g��|�|j
|||g�|�|j
||g�|�t	|j
|�t	||g��dSr�)rrr�r�r�r`r�Zinit_extendorsrpr�rOr�r�r
r
r�)test_init_extendors_after_registry_update�s 

�
�z@AdapterLookupBaseTests.test_init_extendors_after_registry_updatecCs�ddlm}ddlm}|d�}|d|f�}|��}|�|�}|�|�|�|�|�t|j	�
��t|||g��|�|j	|||g�|�|j	||g�|�t|j	|�t||g��dSr�)rrr�r�r�r`rRrpr�rOr�r�r
r
r�test_add_extendor�s 


�
�z(AdapterLookupBaseTests.test_add_extendorcCs�ddlm}ddlm}|d�}|d|f�}|�||�}|�|�}|�|�|�t|j	�
��t|||g��|�|j	||g�|�|j	||g�|�t|j	|�t|g��dSr�)rrr�r�r�r`rXrpr�rOr�r�r
r
r�test_remove_extendor�s

��z+AdapterLookupBaseTests.test_remove_extendorcCstddlm}|d�}|d|f�}|��}|�|�}|�|f|�}|�|d�|�t|j�d�|�|�	�|j�dS�Nrr�r�r�ro)
r�r�r�r`r�rpr'r�r��weakref�rr�r�r�rlr��resultr
r
r�test__uncached_lookup_empty_ro��
z5AdapterLookupBaseTests.test__uncached_lookup_empty_rocCshddlm}|d�}|d|f�}|�||�}|��}|j�|�|�|�}|�|f|�}|�|d�dS�Nrr�r�r�)	r�r�r�r�r�r;r`r�rp�rr�r�r�rl�subrr�r�r
r
r� test__uncached_lookup_order_miss�s
z7AdapterLookupBaseTests.test__uncached_lookup_order_misscCstddlm}|d�}|d|f�}|��}|��}iig|_|j�|�|�|�}||_|�	|f|�}|�
|d�dSr�)r�r�r�r�r{r�r;r`rkr�rpr�r
r
r�$test__uncached_lookup_extendors_miss��

z;AdapterLookupBaseTests.test__uncached_lookup_extendors_missc
Cs�ddlm}|d�}|d|f�}|d�}|�||�}|��}t�}i||d|iiig|_|j�|�|�|�}||_	|�
|f|�}	|�|	d�dS�Nrr�r�r��IQuxr��r�r�r�r�rZr{r�r;r`rkr�rp�
rr�r�r�r�rlr�Z
irrelevantr�r�r
r
r�1test__uncached_lookup_components_miss_wrong_ifaces�
zHAdapterLookupBaseTests.test__uncached_lookup_components_miss_wrong_ifacec	Cs�ddlm}|d�}|d|f�}|�||�}|��}t�}i||d|iiig|_|j�|�|�|�}||_	|�
|f|�}|�|d�dS�Nrr�r�r��	wrongnamer��	rr�r�r�rlr�r�r�r�r
r
r�0test__uncached_lookup_components_miss_wrong_names�
zGAdapterLookupBaseTests.test__uncached_lookup_components_miss_wrong_namec	Cs�ddlm}|d�}|d|f�}|�||�}|��}t�}i||d|iiig|_|j�|�|�|�}||_	|�
|f|�}|�||�dS�Nrr�r�r�r��r�r�r�r�rZr{r�r;r`rkr�ri)	rr�r�r�rlr��	_expectedr�r�r
r
r� test__uncached_lookup_simple_hit*��
z7AdapterLookupBaseTests.test__uncached_lookup_simple_hitc
Cs�ddlm}|d�}|d|f�}|�||�}|��}t�}i||d|iiig|_|j�|�|�|�}||_	|�
|f|�}|�
|f|�}	|�||�|�|	|�dSr�r�)
rr�r�r�rlr�r�r�r�Zresult2r
r
r�"test__uncached_lookup_repeated_hit;s �
z9AdapterLookupBaseTests.test__uncached_lookup_repeated_hitcCs�ddlm}ddlm}|d�}|d|f�}||�Gdd�dt��}|�}|��}|��}iig|_|j�	|�|�
|�}	|	j|	_|	|_
t�}
|	j|f||
d�}|�||
�dS)	Nr��implementerr�r�r�c@r)zFAdapterLookupBaseTests.test_queryMultiAdaptor_lookup_miss.<locals>.FooNrr
r
r
r�FooS�r���default)�zope.interface.declarationsr�r�r�rZr�r�r{r�r;r`r�r	rk�queryMultiAdapterri)rr�r�r�r�r��foorlr�r�rr�r
r
r�"test_queryMultiAdaptor_lookup_missNs&�
z9AdapterLookupBaseTests.test_queryMultiAdaptor_lookup_misscslddlm}ddlm}|d��|��}|�|���j�_��fdd�}tt	u}|j
|||r0dndd	�dS)
Nrr�)�MissingSomeAttrsr�cs��|f��Sr)r�)Zob�r�r�r
r�testrs�zVAdapterLookupBaseTests.test_queryMultiAdapter_errors_on_attribute_access.<locals>.testr[Z__providedBy__)Zexpected_missing)r�r��zope.interface.testsr�r�r`r�r	�str�bytesZtest_raises)rr�r�rlr�ZPY3r
r�r�1test_queryMultiAdapter_errors_on_attribute_accesses


�zHAdapterLookupBaseTests.test_queryMultiAdapter_errors_on_attribute_accesscs�ddlm}ddlm}|d�}|d|f�}||�Gdd�dt��}|�}|�||�}|��}t�}	g��fdd	�}
i||d
|
iiig|_|j�	|�|�
|�}|j|_||_
t�}|j|f||d�}
|�|
|�|��|g�dS)Nrr�r�r�r�c@r)zGAdapterLookupBaseTests.test_queryMultiAdaptor_factory_miss.<locals>.FooNrr
r
r
rr��r�r�crErrrFrr
rrJ�r#zLAdapterLookupBaseTests.test_queryMultiAdaptor_factory_miss.<locals>._factoryr�r��r�r�r�r�rZr�r�r{r�r;r`r�r	rkr�rirp)rr�r�r�r�r�r�rlr�r�rJr�rr�r
rr�#test_queryMultiAdaptor_factory_miss|s.�
z:AdapterLookupBaseTests.test_queryMultiAdaptor_factory_missc
s�ddlm}ddlm}|d�}|d|f�}||�Gdd�dt��}|�}|�||�}|��}t��g���fdd	�}	i||d
|	iiig|_|j�	|�|�
|�}
|
j|
_|
|_
t�}|
j|f||d�}|�|��|��|g�dS)Nrr�r�r�r�c@r)zFAdapterLookupBaseTests.test_queryMultiAdaptor_factory_hit.<locals>.FooNrr
r
r
rr��r�r�cs��|��SrrrF�rr�r
rrJ�rUzKAdapterLookupBaseTests.test_queryMultiAdaptor_factory_hit.<locals>._factoryr�r�r�)
rr�r�r�r�r�r�rlr�rJr�rr�r
r�r�"test_queryMultiAdaptor_factory_hit�s.�
z9AdapterLookupBaseTests.test_queryMultiAdaptor_factory_hitcsd|�|���}�fdd�}dd��||_tt|�ddtt|�g}|�|d�}|�||dd|f�dS)NcrKrr
�r���factoryr
rr	�rHzKAdapterLookupBaseTests.test_queryMultiAdapter_super_unwraps.<locals>.lookupcWs|Srr
r�r
r
rr��rHzLAdapterLookupBaseTests.test_queryMultiAdapter_super_unwraps.<locals>.factory�*�abc)r`r�r	rYr�r�rp)rr�r	Zobjectsr�rZr�r�$test_queryMultiAdapter_super_unwraps�s �
�z;AdapterLookupBaseTests.test_queryMultiAdapter_super_unwrapscCstddlm}|d�}|d|f�}|��}|�|�}|�|f|�}|�|d�|�t|j�d�|�|�	�|j�dS)Nrr�r�r�r
ro)
r�r�r�r`r�rpr'r�r�r�r�r
r
r�!test__uncached_lookupAll_empty_ro�r�z8AdapterLookupBaseTests.test__uncached_lookupAll_empty_rocCsnddlm}|d�}|d|f�}|�||�}|��}|j�|�|�|�}||_|�|f|�}|�	|d�dS�Nrr�r�r�r
)
r�r�r�r�r�r;r`rkr�rpr�r
r
r�#test__uncached_lookupAll_order_miss��
z:AdapterLookupBaseTests.test__uncached_lookupAll_order_misscCstddlm}|d�}|d|f�}|��}|��}iig|_|j�|�|�|�}||_|�	|f|�}|�
|d�dSr�)r�r�r�r�r{r�r;r`rkr�rpr�r
r
r�'test__uncached_lookupAll_extendors_miss�r�z>AdapterLookupBaseTests.test__uncached_lookupAll_extendors_missc
Cs�ddlm}|d�}|d|f�}|d�}|�||�}|��}t�}i||d|iiig|_|j�|�|�|�}||_	|�
|f|�}	|�|	d�dS)Nrr�r�r�r�r�r
)r�r�r�r�rZr{r�r;r`rkr�rpr�r
r
r�(test__uncached_lookupAll_components_miss���
z?AdapterLookupBaseTests.test__uncached_lookupAll_components_missc
Cs�ddlm}|d�}|d|f�}|�||�}|��}t�}t�}i||||d�iig|_|j�|�|�|�}||_	|�
|f|�}	|�t|	�d|fd|fg�dS�Nrr�r�r�)r��namedr�r)
r�r�r�r�rZr{r�r;r`rkr�rpr��
rr�r�r�rlr�r�Z_namedr�r�r
r
r�#test__uncached_lookupAll_simple_hits�
 z:AdapterLookupBaseTests.test__uncached_lookupAll_simple_hitc
Cs�ddlm}|d�}|d|f�}|�||�}|��}t�}t�}i||||d�iig|_|j�|�|�|�}|j	|_
||_|�|f|�}	|�
t|	�ddg�dSr)r�r�r�r�rZr{r�r;r`r�rgrk�namesrpr�rr
r
r�
test_namess �
z!AdapterLookupBaseTests.test_namescCstddlm}|d�}|d|f�}|��}|�|�}|�|f|�}|�|g�|�t|j�d�|�|�	�|j�dSr�)
r�r�r�r`r�rpr'r�r�r�r�r
r
r�%test__uncached_subscriptions_empty_ro(r�z<AdapterLookupBaseTests.test__uncached_subscriptions_empty_rocCsnddlm}|d�}|d|f�}|�||�}|��}|j�|�|�|�}||_|�|f|�}|�	|g�dSr�)
r�r�r�r�r�r;r`rkr�rpr�r
r
r�'test__uncached_subscriptions_order_miss3r�z>AdapterLookupBaseTests.test__uncached_subscriptions_order_misscCstddlm}|d�}|d|f�}|��}|��}iig|_|j�|�|�|�}||_|�	|f|�}|�
|g�dSr�)r�r�r�r�r�r�r;r`rkr�rpr�r
r
r�+test__uncached_subscriptions_extendors_miss?r�zBAdapterLookupBaseTests.test__uncached_subscriptions_extendors_missc
Cs�ddlm}|d�}|d|f�}|d�}|�||�}|��}t�}i||d|iiig|_|j�|�|�|�}||_	|�
|f|�}	|�|	g�dSr��r�r�r�r�rZr�r�r;r`rkr�rpr�r
r
r�8test__uncached_subscriptions_components_miss_wrong_ifaceLrzOAdapterLookupBaseTests.test__uncached_subscriptions_components_miss_wrong_ifacec	Cs�ddlm}|d�}|d|f�}|�||�}|��}t�}i||d|iiig|_|j�|�|�|�}||_	|�
|f|�}|�|g�dSr�rr�r
r
r�7test__uncached_subscriptions_components_miss_wrong_name^r�zNAdapterLookupBaseTests.test__uncached_subscriptions_components_miss_wrong_namecCs�ddlm}|d�}|d|f�}|�||�}|��}Gdd�dt�}|�|�}}i||d||fiiig|_|j�|�|�|�}	|	|_	|	�
|f|�}
|�t|
�t||g��dS)Nrr�r�r�c@rw)zKAdapterLookupBaseTests.test__uncached_subscriptions_simple_hit.<locals>.FoocSsdS)NTr
r,r
r
r�__lt__vrHzRAdapterLookupBaseTests.test__uncached_subscriptions_simple_hit.<locals>.Foo.__lt__N)rrr	rr
r
r
rr�ur�r�r�)
r�r�r�r�rZr�r�r;r`rkr�rpr�)rr�r�r�rlr�r��_exp1�_exp2r�r�r
r
r�'test__uncached_subscriptions_simple_hitos�
z>AdapterLookupBaseTests.test__uncached_subscriptions_simple_hitc
s�ddlm}ddlm}|d�}|d|f�}||�Gdd�dt��}|�}|�||�}|�||�}|��}i��fdd	�}	�fd
d�}
i|dd|	|
fiiig|_|j�	|�|�
|�}|j|_||_
|�|fd�}|�|d
�|��|g|gd��dS)Nrr�r�r�r�c@r)z@AdapterLookupBaseTests.test_subscribers_wo_provided.<locals>.FooNrr
r
r
rr��r�r�c���dg��|�dS�Nr���
setdefaultr;rF��_calledr
rr���zFAdapterLookupBaseTests.test_subscribers_wo_provided.<locals>._factory1cr�Nr�rrFrr
rr��rzFAdapterLookupBaseTests.test_subscribers_wo_provided.<locals>._factory2r�r
)r�r��r�r�r�r�rZr�r�r�r�r;r`r�rqrkZsubscribersrp)
rr�r�r�r�r�r�rlr�r�r�r�r�r
rr�test_subscribers_wo_provided�s.�
z3AdapterLookupBaseTests.test_subscribers_wo_providedcs ddlm}ddlm}|d�}|d|f�}||�Gdd�dt��}|�}|�||�}|�||�}|��}i�t�t�����fdd	�}	��fd
d�}
�fdd
�}i||d|	|
|fiiig|_|j�	|�|�
|�}|j|_||_
|�|f|�}
|�|
��g�|��|g|g|gd��dS)Nrr�r�r�r�c@r)z?AdapterLookupBaseTests.test_subscribers_w_provided.<locals>.FooNrr
r
r
rr��r�r�c���dg��|��SrrrF)rrr
rr���zEAdapterLookupBaseTests.test_subscribers_w_provided.<locals>._factory1crrrrF)rrr
rr��rzEAdapterLookupBaseTests.test_subscribers_w_provided.<locals>._factory2cr)N�_side_effect_onlyrrFrr
rr�rzMAdapterLookupBaseTests.test_subscribers_w_provided.<locals>._side_effect_onlyr�)r�r�rr)rr�r�r�r�r�r�rlr�r�r�rr�r�r
)rrrr�test_subscribers_w_provided�s<�
��z2AdapterLookupBaseTests.test_subscribers_w_provided))rrr	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�rrrrr	r
rr
rrrrvr
r
rZrr�asL


r�c@s$eZdZdd�Zdd�Zdd�ZdS)�VerifyingAdapterRegistryTestscCr?)Nr)�VerifyingAdapterRegistry)rCr!)rr!r
r
rr^�rEz-VerifyingAdapterRegistryTests._getTargetClasscOs|��|i|��Srr_)rr��kwr
r
rr`�sz&VerifyingAdapterRegistryTests._makeOnecCs.ddlm}ddlm}|��}|||�dS)Nr)�verifyObject)�IAdapterRegistry)Zzope.interface.verifyr#Zzope.interface.interfacesr$r`)rr#r$rlr
r
r�,test_verify_object_provides_IAdapterRegistry�szJVerifyingAdapterRegistryTests.test_verify_object_provides_IAdapterRegistryN)rrr	r^r`r%r
r
r
rr �sr c@sDeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�AdapterRegistryTestscCr?)Nr)�AdapterRegistry)rCr')rr'r
r
rr^�rEz$AdapterRegistryTests._getTargetClasscCs|��}|�t|j�d�dSr�)r`rpr'�_v_subregistries)r�arr
r
r�test_ctor_no_bases�sz'AdapterRegistryTests.test_ctor_no_basescCsJ|��}|�|g�}|�t|j�d�|�t|j�d�|�||j�dSrz)r`rpr'r(r�)r�base�subr
r
r�test_ctor_w_bases�s
z&AdapterRegistryTests.test_ctor_w_basescCsZ|��}|��}|�|g�}|g|_|�t|j�d�|�t|j�d�|�||j�dSrz�r`rxrpr'r(r��r�before�afterr,r
r
r�,test__setBases_removing_existing_subregistry�szAAdapterRegistryTests.test__setBases_removing_existing_subregistrycCsr|��}|��}|��}|�|g�}|jd�|�|g|_|�t|j�d�|�t|j�d�|�||j�dS)Nrxrro)r`�__dict__r;rxrpr'r(r�)rr0Zstrayr1r,r
r
r�test__setBases_wo_stray_entry�sz2AdapterRegistryTests.test__setBases_wo_stray_entrycCsj|��}|��}|�|g�}||g|_|�t|j�d�|�t|j�d�|�||j�|�||j�dSrnr.r/r
r
r�*test__setBases_w_existing_entry_continuings
z?AdapterRegistryTests.test__setBases_w_existing_entry_continuingcCsj|��}Gdd�dt�}|�|�}}|�|�|�|�t�}|�|�|�|j|�|�|j|�dS)Nc@seZdZdZdd�ZdS)zBAdapterRegistryTests.test_changed_w_subregistries.<locals>.DerivedNcSr�rrJ)rZoriginally_changedr
r
rrMr zJAdapterRegistryTests.test_changed_w_subregistries.<locals>.Derived.changed)rrr	rKrMr
r
r
rrsr)r`rZZ_addSubregistryrMrirK)rr+rZderived1Zderived2rLr
r
r�test_changed_w_subregistriess


z1AdapterRegistryTests.test_changed_w_subregistriesN)
rrr	r^r*r-r2r4r5r6r
r
r
rr&�s		
r&c@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�
Test_utilscCs,ddlm}ddlm}|�|d�|�dS)Nr��_convert_None_to_Interfacer)rCr9r�rri)rr9rr
r
r�&test__convert_None_to_Interface_w_Nonesz1Test_utils.test__convert_None_to_Interface_w_NonecCs&ddlm}t�}|�||�|�dS)Nrr8)rCr9rZri)rr9r-r
r
r�'test__convert_None_to_Interface_w_other$sz2Test_utils.test__convert_None_to_Interface_w_othercCs<ddlm}d}d}||�}|�||�|�|t|��dS)Nr��_normalize_namesstrr�)rCr=rpr|r+)rr=ZSTR�UNICODEZnormr
r
r�test__normalize_name_str)sz#Test_utils.test__normalize_name_strcCs$ddlm}d}|�||�|�dS)Nrr<Zustr)rCr=rp)rr=ZUSTRr
r
r�test__normalize_name_unicode1sz'Test_utils.test__normalize_name_unicodecCs6ddlm}dddgit�fD]	}|�t||�qdS)Nrr<rog�?r
)rCr=rZr��	TypeError)rr=r-r
r
r�test__normalize_name_other7s�z%Test_utils.test__normalize_name_otherN)rrr	r:r;r?r@rBr
r
r
rr7sr7)r�Zunittestr�rrrZrr2r9r<r=ZTestCaser>r�r�rxr|r�r�r r&r7r
r
r
r�<module>sF
	U2K��k@

Youez - 2016 - github.com/yon3zu
LinuXploit