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_adapter.cpython-38.pyc
U

ؒ�]���@s�dZddlZdd�ZGdd�dej�ZGdd�dej�ZGd	d
�d
e�ZGdd�dej�ZGd
d�de�ZGdd�dej�Z	Gdd�dej�Z
Gdd�dej�ZdS)zAdapter registry tests
�Nc
	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@seZdZdS)z_makeInterfaces.<locals>.IB0N��__name__�
__module__�__qualname__�rr�C/usr/lib/python3/dist-packages/zope/interface/tests/test_adapter.py�IB0sr
c@seZdZdS)z_makeInterfaces.<locals>.IB1Nrrrrr	�IB1src@seZdZdS)z_makeInterfaces.<locals>.IB2Nrrrrr	�IB2src@seZdZdS)z_makeInterfaces.<locals>.IB3Nrrrrr	�IB3sr
c@seZdZdS)z_makeInterfaces.<locals>.IB4Nrrrrr	�IB4src@seZdZdS)z_makeInterfaces.<locals>.IF0Nrrrrr	�IF0src@seZdZdS)z_makeInterfaces.<locals>.IF1Nrrrrr	�IF1src@seZdZdS)z_makeInterfaces.<locals>.IR0Nrrrrr	�IR0src@seZdZdS)z_makeInterfaces.<locals>.IR1Nrrrrr	�IR1 sr)�zope.interfacer)
rr
rrr
rrrrrrrr	�_makeInterfacessrc@s�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,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7S)8�BaseAdapterRegistryTestscCs<ddlm}Gdd�d|�}|jD]}t|j|t��q"|S)Nr)�BaseAdapterRegistryc@seZdZGdd�de�ZdS)z6BaseAdapterRegistryTests._getTargetClass.<locals>._CUTc@s4eZdZdZZdd�Zdd�Zdd�Zdd	�Zd
S)zBBaseAdapterRegistryTests._getTargetClass.<locals>._CUT.LookupClassrcSsdS�Nr)�self�regrrr	�__init__,szKBaseAdapterRegistryTests._getTargetClass.<locals>._CUT.LookupClass.__init__cSs|j|f7_dSr��_changed)r�origrrr	�changed.szJBaseAdapterRegistryTests._getTargetClass.<locals>._CUT.LookupClass.changedcSs|j|f7_dSr)�
_extendors�r�providedrrr	�add_extendor0szOBaseAdapterRegistryTests._getTargetClass.<locals>._CUT.LookupClass.add_extendorcst�fdd�|jD��|_dS)Ncsg|]}|�kr|�qSrr)�.0�x�r!rr	�
<listcomp>3s�zfBaseAdapterRegistryTests._getTargetClass.<locals>._CUT.LookupClass.remove_extendor.<locals>.<listcomp>)�tuplerr rr%r	�remove_extendor2szRBaseAdapterRegistryTests._getTargetClass.<locals>._CUT.LookupClass.remove_extendorN)	rrrrrrrr"r(rrrr	�LookupClass*s
r)N)rrr�objectr)rrrr	�_CUT)sr+)�zope.interface.adapterr�
_delegated�setattrr)r*)rrr+�namerrr	�_getTargetClass's

z(BaseAdapterRegistryTests._getTargetClasscCs
|���Sr�r0�rrrr	�_makeOne9sz!BaseAdapterRegistryTests._makeOnecCs:|��}|�}|jD] }|�t||�t|j|�k�qdSr)r0r-�
assertTrue�getattr�	_v_lookup)rZCUT�registryr/rrr	�test_lookup_delegation<s
�z/BaseAdapterRegistryTests.test_lookup_delegationcCs|��}|�|jd�dS�N�)r3�assertEqual�_generation�rr7rrr	�"test__generation_on_first_creationCsz;BaseAdapterRegistryTests.test__generation_on_first_creationcCs>|��}t�}|�|�|�|jd�|�|jj||f�dS�N�)r3r*rr;r<r6r)rr7rrrr	�&test__generation_after_calling_changedHs

z?BaseAdapterRegistryTests.test__generation_after_calling_changedcCs2Gdd�dt�}|��}|f|_|�|jd�dS)Nc@seZdZdS)zQBaseAdapterRegistryTests.test__generation_after_changing___bases__.<locals>._BaseNrrrrr	�_BaseQsrBr@)r*r3�	__bases__r;r<)rrBr7rrr	�)test__generation_after_changing___bases__PszBBaseAdapterRegistryTests.test__generation_after_changing___bases__c	Csnt�\	}}}}}}}}}	|��}
|
�|g|dd�|�|
�|g|d�d�|�t|
j�d�|�|
jd�dS)N��A1r@)rr3�registerr;�
registered�len�	_adaptersr<�rr
rrr
rrrrrr7rrr	�
test_registerVsz&BaseAdapterRegistryTests.test_registerc	CsNt�\	}}}}}}}}}	|��}
|�t��|
�|g|t�d�W5QRXdS)NrF)rr3�assertRaises�
ValueErrorrGr*rKrrr	�test_register_with_invalid_name^sz8BaseAdapterRegistryTests.test_register_with_invalid_namec	CsZt�\	}}}}}}}}}	|��}
|
�dg|dd�|
�dg|dd�|�t|
j�d�dS)NrErFr)rr3rGr;rIrJrKrrr	�)test_register_with_value_None_unregistersds
zBBaseAdapterRegistryTests.test_register_with_value_None_unregistersc
	Csbt�\	}}}}}}}}}	|��}
t�}|
�dg|d|�|
j}|
�dg|d|�|�|
j|�dS�NrE)rr3r*rGr<r;)
rr
rrr
rrrrrr7Z_valueZ_beforerrr	�test_register_with_same_valueksz6BaseAdapterRegistryTests.test_register_with_same_valuecCs$|��}|�|�dgdd�d�dSrQ)r3r;rHr=rrr	�test_registered_emptytsz.BaseAdapterRegistryTests.test_registered_emptyc	CsNt�\	}}}}}}}}}	|��}
|
�|gddd�|�|
�|gdd�d�dS�NrErF)rr3rGr;rHrKrrr	�test_registered_non_empty_missxsz7BaseAdapterRegistryTests.test_registered_non_empty_misscCs6|��}|�dgddd�|�|�dgdd�d�dSrT)r3rGr;rHr=rrr	�test_registered_non_empty_hit~sz6BaseAdapterRegistryTests.test_registered_non_empty_hitcCs4|��}|�dgdd�|�|�dgdd�d�dSrQ)r3�
unregisterr;rHr=rrr	�test_unregister_empty�sz.BaseAdapterRegistryTests.test_unregister_emptyc	Cs^t�\	}}}}}}}}}	|��}
|
�|gddd�|
�|gdd�|�|
�|gdd�d�dSrT�rr3rGrWr;rHrKrrr	�*test_unregister_non_empty_miss_on_required�s
zCBaseAdapterRegistryTests.test_unregister_non_empty_miss_on_requiredc	Cs^t�\	}}}}}}}}}	|��}
|
�|gddd�|
�|gdd�|�|
�|gdd�d�dS)NrErFZnonesuchrYrKrrr	�&test_unregister_non_empty_miss_on_name�s
z?BaseAdapterRegistryTests.test_unregister_non_empty_miss_on_namec
	Csnt�\	}}}}}}}}}	|��}
t�}t�}|
�|gdd|�|
�|gdd|�|�|
�|gdd�|k�dSrQ)rr3r*rGrWr4rH�
rr
rrr
rrrrrr7rZnomatchrrr	�(test_unregister_with_value_not_None_miss�szABaseAdapterRegistryTests.test_unregister_with_value_not_None_missc
	Cs�t�\	}}}}}}}}}	|��}
t�}t�}|
�||gdd|�|
�||gdd|�|�||
jd|k�|�||
jd|k�|
�||gdd|�|�||
jd|k�|�||
jd|k�dS)NrEr@)rr3r*rGr4rJrWZassertFalse)
rr
rrr
rrrrrr7ZoneZanotherrrr	�.test_unregister_hit_clears_empty_subcomponents�szGBaseAdapterRegistryTests.test_unregister_hit_clears_empty_subcomponentscCs4|��}|�dgdd�|�|�dgdd�d�dSrQ)r3�unsubscriber;rHr=rrr	�test_unsubscribe_empty�sz/BaseAdapterRegistryTests.test_unsubscribe_emptyc	Cs\t�\	}}}}}}}}}	|��}
t�}|
�|gd|�|
�|gd|�|�t|
j�d�dS�Nr�rr3r*�	subscriber_r;rI�_subscribers)rr
rrr
rrrrrr7rrrr	�test_unsubscribe_hit�sz-BaseAdapterRegistryTests.test_unsubscribe_hitc	Cs�t�\	}}}}}}}}}	|��}
t�}t�}t�}
t�}|
�|gd|�|
�|gd|�|
�|g||
�|
�|g||�|
�|g||�|
�|g||
�|
�|gd|�|
�|gd|�|�t|
j�d�dSrarb)rr
rrr
rrrrrr7�first�second�thirdZfourthrrr	�test_unsubscribe_after_multiple�sz8BaseAdapterRegistryTests.test_unsubscribe_after_multiplec	Csvt�\	}}}}}}}}}	|��}
t�}t�}t�}
|
�|gd|�|
�|gd|�|
�|gd�|�t|
j�d�dSrarb)rr
rrr
rrrrrr7rfrgrhrrr	�&test_unsubscribe_w_None_after_multiple�sz?BaseAdapterRegistryTests.test_unsubscribe_w_None_after_multiplec	Csht�\	}}}}}}}}}	|��}
|
�|gdd�|�t|
j�d�|
�|gdd�|�t|
j�d�dS)NrFr@rE�rr3rcr;rIrdr_rKrrr	�+test_unsubscribe_non_empty_miss_on_required�szDBaseAdapterRegistryTests.test_unsubscribe_non_empty_miss_on_requiredc	Csht�\	}}}}}}}}}	|��}
|
�|gdd�|�t|
j�d�|
�|gdd�|�t|
j�d�dS)NrFr@ZA2rkrKrrr	�(test_unsubscribe_non_empty_miss_on_value�szABaseAdapterRegistryTests.test_unsubscribe_non_empty_miss_on_valuec
	Csbt�\	}}}}}}}}}	|��}
t�}t�}|
�|gd|�|
�|gd|�|�t|
j�d�dSr?rbr\rrr	�)test_unsubscribe_with_value_not_None_miss�szBBaseAdapterRegistryTests.test_unsubscribe_with_value_not_None_misscCs|�d�dS)Nz*Example method, not intended to be called.�Zfailr2rrr	�_instance_method_notify_target�sz7BaseAdapterRegistryTests._instance_method_notify_targetc	Cslt�\	}}}}}}}}}	|��}
|�t|
j�d�|
�|gd|j�|
�|gd|j�|�t|
j�d�dSra)rr3r;rIrdrcrpr_rKrrr	� test_unsubscribe_instance_method�sz9BaseAdapterRegistryTests.test_unsubscribe_instance_methodN)rrrr0r3r8r>rArDrLrOrPrRrSrUrVrXrZr[r]r^r`rerirjrlrmrnrprqrrrr	r%s6		
	rc@s�eZdZdd�Zd8dd�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�ZdS)9�LookupBaseFallbackTestscCsddlm}|S�Nr)�LookupBaseFallback)r,rt)rrtrrr	r0�sz'LookupBaseFallbackTests._getTargetClassNcsR�dkrdd���dkr dd���dkr0dd��G���fdd�d|���}|�S)	NcSsdSrr�r�requiredr!r/rrr	�	uc_lookupsz3LookupBaseFallbackTests._makeOne.<locals>.uc_lookupcSs
t��dSr��NotImplementedError�rrvr!rrr	�uc_lookupAllsz6LookupBaseFallbackTests._makeOne.<locals>.uc_lookupAllcSs
t��dSrrxrzrrr	�uc_subscriptions	sz:LookupBaseFallbackTests._makeOne.<locals>.uc_subscriptionscseZdZ�Z�Z�ZdS)z1LookupBaseFallbackTests._makeOne.<locals>.DerivedN)rrr�_uncached_lookup�_uncached_lookupAll�_uncached_subscriptionsr�rwr{r|rr	�Derivedsr�r1)rrwr{r|r�rr�r	r3sz LookupBaseFallbackTests._makeOnec	Cs>dd�}|j|d�}|�t��|�ddt��W5QRXdS)NcSs|�d�dS�NzThis should never be calledrorurrr	�_lookupszCLookupBaseFallbackTests.test_lookup_w_invalid_name.<locals>._lookup�rw��A�B)r3rMrN�lookupr*�rr��lbrrr	�test_lookup_w_invalid_namesz2LookupBaseFallbackTests.test_lookup_w_invalid_namecsJg��fdd�}|j|d�}|�ddd�}|�|dk�|��dg�dS)Ncs��|||f�dSr��appendru��_called_withrr	r�szDLookupBaseFallbackTests.test_lookup_miss_no_default.<locals>._lookupr�r�r��C�r�r�r�)r3r�r4r;�rr�r��foundrr�r	�test_lookup_miss_no_defaultsz3LookupBaseFallbackTests.test_lookup_miss_no_defaultcsRg�t�}�fdd�}|j|d�}|�ddd|�}|�||k�|��dg�dS)Ncs��|||f�dSrr�rur�rr	r�%szCLookupBaseFallbackTests.test_lookup_miss_w_default.<locals>._lookupr�r�r�r�r��r*r3r�r4r;�r�_defaultr�r�r�rr�r	�test_lookup_miss_w_default"sz2LookupBaseFallbackTests.test_lookup_miss_w_defaultcs|g�t�t�t�}}}|||g���fdd�}|j|d�}|�ddd�}|�||k�|��dg�|��||g�dS)Ncs��|||f���d�Sra�r��popru�r��_resultsrr	r�1sz?LookupBaseFallbackTests.test_lookup_not_cached.<locals>._lookupr�r�r�r�r�r��r�a�b�cr�r�r�rr�r	�test_lookup_not_cached-s
z.LookupBaseFallbackTests.test_lookup_not_cachedcs�g�t�t�t�}}}|||g���fdd�}|j|d�}|�ddd�}|�ddd�}|�||k�|��dg�|��||g�dS)Ncs��|||f���d�Srar�rur�rr	r�>sz;LookupBaseFallbackTests.test_lookup_cached.<locals>._lookupr�r�r�r�r�r�r�rr�r	�test_lookup_cached:s
z*LookupBaseFallbackTests.test_lookup_cachedcs|g�t�t�t�}}}|||g���fdd�}|j|d�}|�ddd�}|�||k�|��dg�|��||g�dS)Ncs��|||f���d�Srar�rur�rr	r�LszNLookupBaseFallbackTests.test_lookup_not_cached_multi_required.<locals>._lookupr��r��Dr�r��r�r�r�r�r�rr�r	�%test_lookup_not_cached_multi_requiredHs
z=LookupBaseFallbackTests.test_lookup_not_cached_multi_requiredcs�g�t�t�t�}}}|||g���fdd�}|j|d�}|�ddd�}|�ddd�}|�||k�|��dg�|��||g�dS)Ncs��|||f���d�Srar�rur�rr	r�YszJLookupBaseFallbackTests.test_lookup_cached_multi_required.<locals>._lookupr�r�r�r�r�r�r�rr�r	�!test_lookup_cached_multi_requiredUs
z9LookupBaseFallbackTests.test_lookup_cached_multi_requiredcs�g�t�t�t�}}}|||g���fdd�}|j|d�}|�ddd�}|�|�|�ddd�}|�||k�|��ddg�|��|g�dS)Ncs��|||f���d�Srar�rur�rr	r�gszMLookupBaseFallbackTests.test_lookup_not_cached_after_changed.<locals>._lookupr�r�r�r�r�)r*r3r�rr4r;r�rr�r	�$test_lookup_not_cached_after_changedcs

�z<LookupBaseFallbackTests.test_lookup_not_cached_after_changedc	Cs>dd�}|j|d�}|�t��|�ddt��W5QRXdS)NcSs|�d�dSr�rorurrr	r�tszDLookupBaseFallbackTests.test_lookup1_w_invalid_name.<locals>._lookupr�r�r�)r3rMrN�lookup1r*r�rrr	�test_lookup1_w_invalid_namessz3LookupBaseFallbackTests.test_lookup1_w_invalid_namecsJg��fdd�}|j|d�}|�ddd�}|�|dk�|��dg�dS)Ncs��|||f�dSrr�rur�rr	r�}szELookupBaseFallbackTests.test_lookup1_miss_no_default.<locals>._lookupr�r�r�r�r�)r3r�r4r;r�rr�r	�test_lookup1_miss_no_default{sz4LookupBaseFallbackTests.test_lookup1_miss_no_defaultcsRg�t�}�fdd�}|j|d�}|�ddd|�}|�||k�|��dg�dS)Ncs��|||f�dSrr�rur�rr	r��szDLookupBaseFallbackTests.test_lookup1_miss_w_default.<locals>._lookupr�r�r�r�r��r*r3r�r4r;r�rr�r	�test_lookup1_miss_w_default�sz3LookupBaseFallbackTests.test_lookup1_miss_w_defaultcspg�t�}�fdd�}|j|d�}|�ddd|�}|�||k�|�ddd|�}|�||k�|��dg�dS)Ncs��|||f�dSrr�rur�rr	r��szSLookupBaseFallbackTests.test_lookup1_miss_w_default_negative_cache.<locals>._lookupr�r�r�r�r�r�r�rr�r	�*test_lookup1_miss_w_default_negative_cache�szBLookupBaseFallbackTests.test_lookup1_miss_w_default_negative_cachecs|g�t�t�t�}}}|||g���fdd�}|j|d�}|�ddd�}|�||k�|��dg�|��||g�dS)Ncs��|||f���d�Srar�rur�rr	r��sz@LookupBaseFallbackTests.test_lookup1_not_cached.<locals>._lookupr�r�r�r�r�r�r�rr�r	�test_lookup1_not_cached�s
z/LookupBaseFallbackTests.test_lookup1_not_cachedcs�g�t�t�t�}}}|||g���fdd�}|j|d�}|�ddd�}|�ddd�}|�||k�|��dg�|��||g�dS)Ncs��|||f���d�Srar�rur�rr	r��sz<LookupBaseFallbackTests.test_lookup1_cached.<locals>._lookupr�r�r�r�r�r�r�rr�r	�test_lookup1_cached�s
z+LookupBaseFallbackTests.test_lookup1_cachedcs�g�t�t�t�}}}|||g���fdd�}|j|d�}|�ddd�}|�|�|�ddd�}|�||k�|��ddg�|��|g�dS)Ncs��|||f���d�Srar�rur�rr	r��szNLookupBaseFallbackTests.test_lookup1_not_cached_after_changed.<locals>._lookupr�r�r�r�r�)r*r3r�rr4r;r�rr�r	�%test_lookup1_not_cached_after_changed�s

�z=LookupBaseFallbackTests.test_lookup1_not_cached_after_changedc	Cs@t�t�}}|��}|�t��|�||t��W5QRXdSr)r*r3rMrN�adapter_hook)r�req�prvr�rrr	� test_adapter_hook_w_invalid_name�sz8LookupBaseFallbackTests.test_adapter_hook_w_invalid_namecCs6t�t�}}|��}|�||d�}|�|dk�dSrQ�r*r3r�r4)rr�r�r�r�rrr	�!test_adapter_hook_miss_no_default�sz9LookupBaseFallbackTests.test_adapter_hook_miss_no_defaultcCs@t�t�t�}}}|��}|�||d|�}|�||k�dSrQr�)rr�r�r�r�r�rrr	� test_adapter_hook_miss_w_default�sz8LookupBaseFallbackTests.test_adapter_hook_miss_w_defaultcsng��fdd���fdd�}t�t�t�}}}|j|d�}|�||d|�}|�||k�|��|g�dS)Ncs��|�dSrr���context)�_f_called_withrr	�_factory�s
zTLookupBaseFallbackTests.test_adapter_hook_hit_factory_returns_None.<locals>._factorycs�Srrru�r�rr	r��szSLookupBaseFallbackTests.test_adapter_hook_hit_factory_returns_None.<locals>._lookupr�r��r*r3r�r4r;�rr�r�r�r�r��adaptedr)r�r�r	�*test_adapter_hook_hit_factory_returns_None�szBLookupBaseFallbackTests.test_adapter_hook_hit_factory_returns_Nonecsvg�t����fdd���fdd�}t�t�t�}}}|j|d�}|�||d|�}|�|�k�|��|g�dS)Ncs��|��Srr�r���_adapterr�rr	r��s
zWLookupBaseFallbackTests.test_adapter_hook_hit_factory_returns_adapter.<locals>._factorycs�Srrrur�rr	r��szVLookupBaseFallbackTests.test_adapter_hook_hit_factory_returns_adapter.<locals>._lookupr�r�r�r�r�r�r�r�r	�-test_adapter_hook_hit_factory_returns_adapter�szELookupBaseFallbackTests.test_adapter_hook_hit_factory_returns_adaptercsvg�t����fdd���fdd�}t�t�t�}}}|j|d�}|�||d|�}|�|�k�|��|g�dS)Ncs��|��Srr�r�r�rr	r��s
z;LookupBaseFallbackTests.test_queryAdapter.<locals>._factorycs�Srrrur�rr	r��sz:LookupBaseFallbackTests.test_queryAdapter.<locals>._lookupr�r�)r*r3�queryAdapterr4r;r�rr�r	�test_queryAdapter�sz)LookupBaseFallbackTests.test_queryAdaptercs\g�t�t�t�g���fdd�}|j|d�}|�dd�}|�|t���|��dg�dS)Ncs��||f�t��Sr�r�r'rzr�rr	�
_lookupAllszCLookupBaseFallbackTests.test_lookupAll_uncached.<locals>._lookupAll�r{r�r��r�r��r*r3�	lookupAllr;r'�rr�r�r�rr�r	�test_lookupAll_uncachedsz/LookupBaseFallbackTests.test_lookupAll_uncachedcshg�t�t�t�g���fdd�}|j|d�}|�dd�}|�dd�}|�|t���|��dg�dS)Ncs��||f�t��Srr�rzr�rr	r�szALookupBaseFallbackTests.test_lookupAll_cached.<locals>._lookupAllr�r�r�r�r�r�rr�r	�test_lookupAll_cachedsz-LookupBaseFallbackTests.test_lookupAll_cachedcs\g�t�t�t�g���fdd�}|j|d�}|�dd�}|�|t���|��dg�dS)Ncs��||f�t��Srr�rzr�rr	�_subscriptionsszKLookupBaseFallbackTests.test_subscriptions_uncached.<locals>._subscriptions�r|r�r�r��r*r3�
subscriptionsr;r'�rr�r�r�rr�r	�test_subscriptions_uncachedsz3LookupBaseFallbackTests.test_subscriptions_uncachedcshg�t�t�t�g���fdd�}|j|d�}|�dd�}|�dd�}|�|t���|��dg�dS)Ncs��||f�t��Srr�rzr�rr	r�(szILookupBaseFallbackTests.test_subscriptions_cached.<locals>._subscriptionsr�r�r�r�r�r�rr�r	�test_subscriptions_cached%sz1LookupBaseFallbackTests.test_subscriptions_cached)NNN)rrrr0r3r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrr	rr�s:�







rrc@seZdZdd�Zdd�ZdS)�LookupBaseTestscCsddlm}|S)Nr)�
LookupBase)r,r�)rr�rrr	r04szLookupBaseTests._getTargetClasscCsRddlm}zddl}Wn$tk
r<|�|��|�YnX|�|��|�dSrs)r,rt�-zope.interface._zope_interface_coptimizations�ImportError�assertIsr0�assertIsNot)rrt�zoperrr	�test_optimizations8sz"LookupBaseTests.test_optimizationsN�rrrr0r�rrrr	r�2sr�c@sVeZdZdd�Zddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�ZdS)�VerifyingBaseFallbackTestscCsddlm}|S�Nr)�VerifyingBaseFallback)r,r�)rr�rrr	r0Dsz*VerifyingBaseFallbackTests._getTargetClassNcsd�dkrdd���dkr dd���dkr0dd��G����fdd�d|�����|�}|�|�|S)	NcSs
t��dSrrxrurrr	rwKsz6VerifyingBaseFallbackTests._makeOne.<locals>.uc_lookupcSs
t��dSrrxrzrrr	r{Nsz9VerifyingBaseFallbackTests._makeOne.<locals>.uc_lookupAllcSs
t��dSrrxrzrrr	r|Qsz=VerifyingBaseFallbackTests._makeOne.<locals>.uc_subscriptionscs*eZdZ�Z�Z�Z��fdd�Z�ZS)z4VerifyingBaseFallbackTests._makeOne.<locals>.Derivedcst�|���||_dSr)�superr�	_registryr=)r��	__class__rr	rWsz=VerifyingBaseFallbackTests._makeOne.<locals>.Derived.__init__)rrrr}r~rr�
__classcell__r�r�rwr{r|)r�r	r�Ssr�)r0r)rr7rwr{r|Zderivedrr�r	r3Hs
z#VerifyingBaseFallbackTests._makeOnecs*Gdd�dt��G�fdd�d�}||�S)Nc@seZdZdZdS)z@VerifyingBaseFallbackTests._makeRegistry.<locals>.WithGenerationr:N)rrrr<rrrr	�WithGeneration_sr�cseZdZ�fdd�ZdS)z:VerifyingBaseFallbackTests._makeRegistry.<locals>.Registrycs�fdd�t|�D�|_dS)Ncsg|]
}���qSrr)r#�i�r�rr	r&cszWVerifyingBaseFallbackTests._makeRegistry.<locals>.Registry.__init__.<locals>.<listcomp>)�range�ro)r�depthr�rr	rbszCVerifyingBaseFallbackTests._makeRegistry.<locals>.Registry.__init__N�rrrrrr�rr	�Registryasr�)r*)rr�r�rr�r	�
_makeRegistry^sz(VerifyingBaseFallbackTests._makeRegistrycs�g�t�t�t�}}}|||g���fdd�}|�d�}|j||d�}|�ddd�}|�ddd�}|�||k�|��dg�|��||g�|jd	jd	7_|�ddd�}|�||k�|��ddg�|��|g�dS)
Ncs��|||f���d�Srar�rur�rr	r�jsz7VerifyingBaseFallbackTests.test_lookup.<locals>._lookup�r�r�r�r�r�r:)r*r�r3r�r4r;r�r<�rr�r�r�r�rr�r�rr�r	�test_lookupfs$

�z&VerifyingBaseFallbackTests.test_lookupcs�g�t�t�t�}}}|||g���fdd�}|�d�}|j||d�}|�ddd�}|�ddd�}|�||k�|��dg�|��||g�|jd	jd	7_|�ddd�}|�||k�|��ddg�|��|g�dS)
Ncs��|||f���d�Srar�rur�rr	r�sz8VerifyingBaseFallbackTests.test_lookup1.<locals>._lookupr�r�r�r�r�r�r:)r*r�r3r�r4r;r�r<r�rr�r	�test_lookup1{s$

�z'VerifyingBaseFallbackTests.test_lookup1cs�t�t�t�g\��}�fdd�}�fdd�}�fdd�}|||g��fdd�}t�t�t�}}}��d	�}	�j|	|d
�}
|
�||d|�}��|�k�|
�||d|�}��|�k�|	jdjd7_|
�||d|�}��|�k�dS)
Ncs�Srrr��r�rr	�	_factory1�sz?VerifyingBaseFallbackTests.test_adapter_hook.<locals>._factory1cs�Srrr��r�rr	�	_factory2�sz?VerifyingBaseFallbackTests.test_adapter_hook.<locals>._factory2cs��d�dSr�ror�r2rr	�	_factory3�sz?VerifyingBaseFallbackTests.test_adapter_hook.<locals>._factory3cs
��d�Sra�r�ru��
_factoriesrr	r��sz=VerifyingBaseFallbackTests.test_adapter_hook.<locals>._lookupr�r�r�r:)r*r�r3r�r4r�r<�rZ_cr�r�r�r�r�r�r�rr�r�r�r�r�r�rr	�test_adapter_hook�s 

z,VerifyingBaseFallbackTests.test_adapter_hookcs�t�t�t�g\��}�fdd�}�fdd�}�fdd�}|||g��fdd�}t�t�t�}}}��d	�}	�j|	|d
�}
|
�||d|�}��|�k�|
�||d|�}��|�k�|	jdjd7_|
�||d|�}��|�k�dS)
Ncs�Srrr�r�rr	r��sz?VerifyingBaseFallbackTests.test_queryAdapter.<locals>._factory1cs�Srrr�r�rr	r��sz?VerifyingBaseFallbackTests.test_queryAdapter.<locals>._factory2cs��d�dSr�ror�r2rr	r��sz?VerifyingBaseFallbackTests.test_queryAdapter.<locals>._factory3cs
��d�Srar�rur�rr	r��sz=VerifyingBaseFallbackTests.test_queryAdapter.<locals>._lookupr�r�r�r:)r*r�r3r�r4r�r<r�r�rr�r	r��s 

z,VerifyingBaseFallbackTests.test_queryAdaptercs�t�t�t�g}t�t�t�g}||g��fdd�}|�d�}|j||d�}|�dd�}|�|t|��|�dd�}|�|t|��|jdjd7_|�dd�}|�|t|��dS)Ncst��d��Sra�r'r�rz�r�rr	r��sz=VerifyingBaseFallbackTests.test_lookupAll.<locals>._lookupAllr�r�r�r�r:)r*r�r3r�r;r'r�r<)r�
_results_1�
_results_2r�rr�r�rrr	�test_lookupAll�s
z)VerifyingBaseFallbackTests.test_lookupAllcs�t�t�t�g}t�t�t�g}||g��fdd�}|�d�}|j||d�}|�dd�}|�|t|��|�dd�}|�|t|��|jdjd7_|�dd�}|�|t|��dS)Ncst��d��Srarrzrrr	r��szEVerifyingBaseFallbackTests.test_subscriptions.<locals>._subscriptionsr�r�r�r�r:)r*r�r3r�r;r'r�r<)rrrr�rr�r�rrr	�test_subscriptions�s
z-VerifyingBaseFallbackTests.test_subscriptions)NNN)rrrr0r3r�r�r�rr�rrrrrr	r�Bs�
r�c@seZdZdd�Zdd�ZdS)�VerifyingBaseTestscCsddlm}|S)Nr)�
VerifyingBase)r,r)rrrrr	r0�sz"VerifyingBaseTests._getTargetClasscCsRddlm}zddl}Wn$tk
r<|�|��|�YnX|�|��|�dSr�)r,r�r�r�r�r0r�)rr�r�rrr	r��sz%VerifyingBaseTests.test_optimizationsNr�rrrr	r�src@s$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,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Z d=d>�Z!d?d@�Z"dAdB�Z#dCdD�Z$dEdF�Z%dGS)H�AdapterLookupBaseTestscCsddlm}|S)Nr)�AdapterLookupBase)r,r
)rr
rrr	r0�sz&AdapterLookupBaseTests._getTargetClasscCs|��|�Srr1r=rrr	r3�szAdapterLookupBaseTests._makeOnecGsGdd�d�}|�S)Nc@seZdZdd�ZdS)z<AdapterLookupBaseTests._makeSubregistry.<locals>.SubregistrycSsg|_g|_dSr)rJrdr2rrr	r�szEAdapterLookupBaseTests._makeSubregistry.<locals>.Subregistry.__init__Nr�rrrr	�Subregistry�srr)rr!rrrr	�_makeSubregistry�sz'AdapterLookupBaseTests._makeSubregistrycGsGdd�d�}||�S)Nc@seZdZdd�ZdS)z6AdapterLookupBaseTests._makeRegistry.<locals>.RegistrycSs||_g|_dSr)�	_providedr�r rrr	r�sz?AdapterLookupBaseTests._makeRegistry.<locals>.Registry.__init__Nr�rrrr	r��sr�r)rr!r�rrr	r��sz$AdapterLookupBaseTests._makeRegistrycCs$|��}|�|�}|�|ji�dSr)r�r3r;r)rr7�albrrr	�test_ctor_empty_registrys
z/AdapterLookupBaseTests.test_ctor_empty_registrycCs�ddlm}ddlm}|d�}|d|�}|�||�}|�|�}|�t|j�	��t|||g��|�|j||g�|�|j||g�|�t|j|�t||g��dS�Nrr��InterfaceClass�IFoo�IBar)
rr�zope.interface.interfacerr�r3r;�sortedr�keys�rrrrrr7rrrr	�test_ctor_w_registry_provided	s

�
�z4AdapterLookupBaseTests.test_ctor_w_registry_providedcCsDGdd�dt�}Gdd�d|��|�}|��}||�}|�|�dS)Nc@seZdZdd�ZdS)zAAdapterLookupBaseTests.test_changed_empty_required.<locals>.MixincWsdSrr�r�otherrrr	rszIAdapterLookupBaseTests.test_changed_empty_required.<locals>.Mixin.changedN�rrrrrrrr	�Mixinsrc@seZdZdS)zCAdapterLookupBaseTests.test_changed_empty_required.<locals>.DerivedNrrrrr	r�sr�)r*r0r�r)rrr�r7rrrr	�test_changed_empty_requireds
z2AdapterLookupBaseTests.test_changed_empty_requiredcCs�Gdd�dt�}Gdd�d|��|�}Gdd�dt�}|d�}|d�}|��}||�}d	|j|<d	|j|<|�|�|�t|j�d
�|�|jd�|�|j|�dS)Nc@seZdZdd�ZdS)z=AdapterLookupBaseTests.test_changed_w_required.<locals>.MixincWsdSrrrrrr	r%szEAdapterLookupBaseTests.test_changed_w_required.<locals>.Mixin.changedNrrrrr	r$src@seZdZdS)z?AdapterLookupBaseTests.test_changed_w_required.<locals>.DerivedNrrrrr	r�'sr�c@s(eZdZdZdd�Zdd�Zdd�ZdS)zCAdapterLookupBaseTests.test_changed_w_required.<locals>.FauxWeakrefNcSs
||_dSr�Z_here)r�hererrr	r+szLAdapterLookupBaseTests.test_changed_w_required.<locals>.FauxWeakref.__init__cSs|jr
|SdSrrr2rrr	�__call__-szLAdapterLookupBaseTests.test_changed_w_required.<locals>.FauxWeakref.__call__cSs
||_dSr)�_unsub)r�targetrrr	r_0szOAdapterLookupBaseTests.test_changed_w_required.<locals>.FauxWeakref.unsubscribe)rrrr"rr!r_rrrr	�FauxWeakref)sr$FTr:r)r*r0r��	_requiredrr;rIr")rrr�r$Zgoner r7rrrr	�test_changed_w_required"s	


z.AdapterLookupBaseTests.test_changed_w_requiredcCs�ddlm}ddlm}|d�}|d|�}|��}|�|�}||g|_|��|�t	|j
���t	|||g��|�|j
||g�|�|j
||g�|�t	|j
|�t	||g��dSr)rrrrr�r3r
Zinit_extendorsr;rrrrrrr	�)test_init_extendors_after_registry_update=s 


�
�z@AdapterLookupBaseTests.test_init_extendors_after_registry_updatecCs�ddlm}ddlm}|d�}|d|�}|��}|�|�}|�|�|�|�|�t|j	�
��t|||g��|�|j	||g�|�|j	||g�|�t|j	|�t||g��dSr)rrrrr�r3r"r;rrrrrrr	�test_add_extendorMs 



�
�z(AdapterLookupBaseTests.test_add_extendorcCs�ddlm}ddlm}|d�}|d|�}|�||�}|�|�}|�|�|�t|j	�
��t|||g��|�|j	|g�|�|j	||g�|�t|j	|�t|g��dSr)rrrrr�r3r(r;rrrrrrr	�test_remove_extendor]s


��z+AdapterLookupBaseTests.test_remove_extendorcCstddlm}|d�}|d|�}|��}|�|�}|�|f|�}|�|d�|�t|j�d�|�|�	�|jk�dS�Nrrrrr:)
rrr�r3r}r;rIr%r4�weakref�rrrrr7r�resultrrr	�test__uncached_lookup_empty_rons

z5AdapterLookupBaseTests.test__uncached_lookup_empty_rocCsfddlm}|d�}|d|�}|�||�}|��}|j�|�|�|�}|�|f|�}|�|d�dS�Nrrrr)	rrr�rr�r�r3r}r;�rrrrr7�subrrr-rrr	� test__uncached_lookup_order_missys

z7AdapterLookupBaseTests.test__uncached_lookup_order_misscCsrddlm}|d�}|d|�}|��}|��}iig|_|j�|�|�|�}||_|�	|f|�}|�
|d�dSr/)rrr�rrJr�r�r3r6r}r;r0rrr	�$test__uncached_lookup_extendors_miss�s


z;AdapterLookupBaseTests.test__uncached_lookup_extendors_missc
Cs�ddlm}|d�}|d|�}|d�}|�||�}|��}t�}i||d|iiig|_|j�|�|�|�}||_	|�
|f|�}	|�|	d�dS�Nrrrr�IQuxrE�rrr�rr*rJr�r�r3r6r}r;�
rrrrr5r7r1�
irrelevantrr-rrr	�1test__uncached_lookup_components_miss_wrong_iface�s
�
zHAdapterLookupBaseTests.test__uncached_lookup_components_miss_wrong_ifacec
Cs�ddlm}|d�}|d|�}|�||�}|��}t�}t�}i||d|iiig|_|j�|�|�|�}||_	|�
|f|�}	|�|	d�dS�Nrrrr�	wrongnamer6)
rrrrr7r1r8r;rr-rrr	�0test__uncached_lookup_components_miss_wrong_name�s
�
zGAdapterLookupBaseTests.test__uncached_lookup_components_miss_wrong_namec	Cs�ddlm}|d�}|d|�}|�||�}|��}t�}i||d|iiig|_|j�|�|�|�}||_	|�
|f|�}|�||k�dS�NrrrrrE�rrr�rr*rJr�r�r3r6r}r4)	rrrrr7r1�	_expectedrr-rrr	� test__uncached_lookup_simple_hit�s
�
z7AdapterLookupBaseTests.test__uncached_lookup_simple_hitc
Cs�ddlm}|d�}|d|�}|�||�}|��}t�}i||d|iiig|_|j�|�|�|�}||_	|�
|f|�}|�
|f|�}	|�||k�|�|	|k�dSr=r>)
rrrrr7r1r?rr-Zresult2rrr	�"test__uncached_lookup_repeated_hit�s 
�
z9AdapterLookupBaseTests.test__uncached_lookup_repeated_hitcCs�ddlm}ddlm}|d�}|d|�}||�Gdd�dt��}|�}|��}|��}iig|_|j�	|�|�
|�}	|	j|	_|	|_
t�}
|	j|f||
d�}|�||
k�dS)	Nr��implementerrrrc@seZdZdS)zFAdapterLookupBaseTests.test_queryMultiAdaptor_lookup_miss.<locals>.FooNrrrrr	�Foo�srD��default)�zope.interface.declarationsrCrrr*r�rrJr�r�r3r}r�r6�queryMultiAdapterr4)rrCrrrrD�foor7r1rr�r-rrr	�"test_queryMultiAdaptor_lookup_miss�s&
�
z9AdapterLookupBaseTests.test_queryMultiAdaptor_lookup_misscs�ddlm}ddlm}|d�}|d|�}||�Gdd�dt��}|�}|�||�}|��}t�}	g��fdd	�}
i||d
|
iiig|_|j�	|�|�
|�}|j|_||_
t�}|j|f||d�}
|�|
|k�|��|g�dS)NrrBrrrc@seZdZdS)zGAdapterLookupBaseTests.test_queryMultiAdaptor_factory_miss.<locals>.FooNrrrrr	rD�srDcs��|�dSrr�r�r�rr	r��s
zLAdapterLookupBaseTests.test_queryMultiAdaptor_factory_miss.<locals>._factoryrErE�rGrCrrr*r�rrJr�r�r3r}r�r6rHr4r;)rrCrrrrDrIr7r1r?r�rr�r-rr�r	�#test_queryMultiAdaptor_factory_miss�s.
�
z:AdapterLookupBaseTests.test_queryMultiAdaptor_factory_missc
s�ddlm}ddlm}|d�}|d|�}||�Gdd�dt��}|�}|�||�}|��}t��g���fdd	�}	i||d
|	iiig|_|j�	|�|�
|�}
|
j|
_|
|_
t�}|
j|f||d�}|�|�k�|��|g�dS)NrrBrrrc@seZdZdS)zFAdapterLookupBaseTests.test_queryMultiAdaptor_factory_hit.<locals>.FooNrrrrr	rDsrDcs��|��Srr�r��r�r?rr	r�s
zKAdapterLookupBaseTests.test_queryMultiAdaptor_factory_hit.<locals>._factoryrErErK)
rrCrrrrDrIr7r1r�rr�r-rrMr	�"test_queryMultiAdaptor_factory_hits.
�
z9AdapterLookupBaseTests.test_queryMultiAdaptor_factory_hitcCstddlm}|d�}|d|�}|��}|�|�}|�|f|�}|�|d�|�t|j�d�|�|�	�|jk�dS)Nrrrrrr:)
rrr�r3r~r;rIr%r4r+r,rrr	�!test__uncached_lookupAll_empty_ro,s

z8AdapterLookupBaseTests.test__uncached_lookupAll_empty_rocCslddlm}|d�}|d|�}|�||�}|��}|j�|�|�|�}||_|�|f|�}|�	|d�dS�Nrrrrr)
rrr�rr�r�r3r6r~r;r0rrr	�#test__uncached_lookupAll_order_miss7s

z:AdapterLookupBaseTests.test__uncached_lookupAll_order_misscCsrddlm}|d�}|d|�}|��}|��}iig|_|j�|�|�|�}||_|�	|f|�}|�
|d�dSrP)rrr�rrJr�r�r3r6r~r;r0rrr	�'test__uncached_lookupAll_extendors_missCs


z>AdapterLookupBaseTests.test__uncached_lookupAll_extendors_missc
Cs�ddlm}|d�}|d|�}|d�}|�||�}|��}t�}i||d|iiig|_|j�|�|�|�}||_	|�
|f|�}	|�|	d�dS)Nrrrrr5rEr)rrr�rr*rJr�r�r3r6r~r;r7rrr	�(test__uncached_lookupAll_components_missPs
�
z?AdapterLookupBaseTests.test__uncached_lookupAll_components_missc
Cs�ddlm}|d�}|d|�}|�||�}|��}t�}t�}i||||d�iig|_|j�|�|�|�}||_	|�
|f|�}	|�t|	�d|fd|fg�dS�Nrrrr)rE�namedrErU)
rrr�rr*rJr�r�r3r6r~r;r�
rrrrr7r1r?Z_namedrr-rrr	�#test__uncached_lookupAll_simple_hitbs
�
z:AdapterLookupBaseTests.test__uncached_lookupAll_simple_hitc
Cs�ddlm}|d�}|d|�}|�||�}|��}t�}t�}i||||d�iig|_|j�|�|�|�}|j	|_
||_|�|f|�}	|�
t|	�ddg�dSrT)rrr�rr*rJr�r�r3r~r�r6�namesr;rrVrrr	�
test_namests 
�
z!AdapterLookupBaseTests.test_namescCstddlm}|d�}|d|�}|��}|�|�}|�|f|�}|�|g�|�t|j�d�|�|�	�|jk�dSr*)
rrr�r3rr;rIr%r4r+r,rrr	�%test__uncached_subscriptions_empty_ro�s

z<AdapterLookupBaseTests.test__uncached_subscriptions_empty_rocCslddlm}|d�}|d|�}|�||�}|��}|j�|�|�|�}||_|�|f|�}|�	|g�dSr/)
rrr�rr�r�r3r6rr;r0rrr	�'test__uncached_subscriptions_order_miss�s

z>AdapterLookupBaseTests.test__uncached_subscriptions_order_misscCsrddlm}|d�}|d|�}|��}|��}iig|_|j�|�|�|�}||_|�	|f|�}|�
|g�dSr/)rrr�rrdr�r�r3r6rr;r0rrr	�+test__uncached_subscriptions_extendors_miss�s


zBAdapterLookupBaseTests.test__uncached_subscriptions_extendors_missc
Cs�ddlm}|d�}|d|�}|d�}|�||�}|��}t�}i||d|iiig|_|j�|�|�|�}||_	|�
|f|�}	|�|	g�dSr4�rrr�rr*rdr�r�r3r6rr;r7rrr	�8test__uncached_subscriptions_components_miss_wrong_iface�s
�
zOAdapterLookupBaseTests.test__uncached_subscriptions_components_miss_wrong_ifacec	Cs�ddlm}|d�}|d|�}|�||�}|��}t�}i||d|iiig|_|j�|�|�|�}||_	|�
|f|�}|�|g�dSr:r])	rrrrr7r1r;rr-rrr	�7test__uncached_subscriptions_components_miss_wrong_name�s
�
zNAdapterLookupBaseTests.test__uncached_subscriptions_components_miss_wrong_namecCs�ddlm}|d�}|d|�}|�||�}|��}Gdd�dt�}|�|�}}i||d||fiiig|_|j�|�|�|�}	|	|_	|	�
|f|�}
|�t|
�t||g��dS)Nrrrrc@seZdZdd�ZdS)zKAdapterLookupBaseTests.test__uncached_subscriptions_simple_hit.<locals>.FoocSsdS)NTrrrrr	�__lt__�szRAdapterLookupBaseTests.test__uncached_subscriptions_simple_hit.<locals>.Foo.__lt__N)rrrr`rrrr	rD�srDrE)
rrr�rr*rdr�r�r3r6rr;r)rrrrr7r1rD�_exp1�_exp2rr-rrr	�'test__uncached_subscriptions_simple_hit�s
�
z>AdapterLookupBaseTests.test__uncached_subscriptions_simple_hitc
s�ddlm}ddlm}|d�}|d|�}||�Gdd�dt��}|�}|�||�}|�||�}|��}i��fdd	�}	�fd
d�}
i|dd|	|
fiiig|_|j�	|�|�
|�}|j|_||_
|�|fd�}|�|d
�|��|g|gd��dS)NrrBrrrc@seZdZdS)z@AdapterLookupBaseTests.test_subscribers_wo_provided.<locals>.FooNrrrrr	rD�srDcs��dg��|�dS�Nr���
setdefaultr�r���_calledrr	r��szFAdapterLookupBaseTests.test_subscribers_wo_provided.<locals>._factory1cs��dg��|�dS�Nr�rer�rgrr	r��szFAdapterLookupBaseTests.test_subscribers_wo_provided.<locals>._factory2rEr)r�r��rGrCrrr*r�rrdr�r�r3rr�r6Zsubscribersr;)
rrCrrrrDrIr7r1r�r�rr-rrgr	�test_subscribers_wo_provided�s.
�
z3AdapterLookupBaseTests.test_subscribers_wo_providedcsddlm}ddlm}|d�}|d|�}||�Gdd�dt��}|�}|�||�}|�||�}|��}i�t�t�����fdd	�}	��fd
d�}
�fdd
�}i||d|	|
|fiiig|_|j�	|�|�
|�}|j|_||_
|�|f|�}
|�|
��g�|��|g|g|gd��dS)NrrBrrrc@seZdZdS)z?AdapterLookupBaseTests.test_subscribers_w_provided.<locals>.FooNrrrrr	rDsrDcs��dg��|��Srdrer�)rhrarr	r�
szEAdapterLookupBaseTests.test_subscribers_w_provided.<locals>._factory1cs��dg��|��Srirer�)rhrbrr	r�szEAdapterLookupBaseTests.test_subscribers_w_provided.<locals>._factory2cs��dg��|�dS)N�_side_effect_onlyrer�rgrr	rlszMAdapterLookupBaseTests.test_subscribers_w_provided.<locals>._side_effect_onlyrE)r�r�rlrj)rrCrrrrDrIr7r1r�r�rlrr-r)rhrarbr	�test_subscribers_w_provided�s<
�
��z2AdapterLookupBaseTests.test_subscribers_w_providedN)&rrrr0r3rr�rrrr&r'r(r)r.r2r3r9r<r@rArJrLrNrOrQrRrSrWrYrZr[r\r^r_rcrkrmrrrr	r	�sF


r	c@sLeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�AdapterRegistryTestscCsddlm}|S)Nr)�AdapterRegistry)r,ro)rrorrr	r0)sz$AdapterRegistryTests._getTargetClasscOs|��||�Srr1)r�args�kwrrr	r3-szAdapterRegistryTests._makeOnecCs|��}|�t|j�d�dSra)r3r;rI�_v_subregistries)rZarrrr	�test_ctor_no_bases0sz'AdapterRegistryTests.test_ctor_no_basescCsL|��}|�|g�}|�t|j�d�|�t|j�d�|�||jk�dS�Nrr:)r3r;rIrrr4)r�base�subrrr	�test_ctor_w_bases4s
z&AdapterRegistryTests.test_ctor_w_basescCs\|��}|��}|�|g�}|g|_|�t|j�d�|�t|j�d�|�||jk�dSrt�r3rCr;rIrrr4�r�before�afterrvrrr	�,test__setBases_removing_existing_subregistry=szAAdapterRegistryTests.test__setBases_removing_existing_subregistrycCst|��}|��}|��}|�|g�}|jd�|�|g|_|�t|j�d�|�t|j�d�|�||jk�dS)NrCrr:)r3�__dict__r�rCr;rIrrr4)rrzZstrayr{rvrrr	�test__setBases_wo_stray_entryFsz2AdapterRegistryTests.test__setBases_wo_stray_entrycCsn|��}|��}|�|g�}||g|_|�t|j�d�|�t|j�d�|�||jk�|�||jk�dSr9rxryrrr	�*test__setBases_w_existing_entry_continuingQs
z?AdapterRegistryTests.test__setBases_w_existing_entry_continuingcCsn|��}Gdd�dt�}|�|�}}|�|�|�|�t�}|�|�|�|j|k�|�|j|k�dS)Nc@seZdZdZdd�ZdS)zBAdapterRegistryTests.test_changed_w_subregistries.<locals>.DerivedNcSs
||_dSrr)rZoriginally_changedrrr	r_szJAdapterRegistryTests.test_changed_w_subregistries.<locals>.Derived.changed)rrrrrrrrr	r�]sr�)r3r*Z_addSubregistryrr4r)rrur�Zderived1Zderived2rrrr	�test_changed_w_subregistries[s


z1AdapterRegistryTests.test_changed_w_subregistriesN)rrrr0r3rsrwr|r~rr�rrrr	rn's		
rnc@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�
Test_utilscCs.ddlm}ddlm}|�|d�|k�dS)Nr��_convert_None_to_Interfacer)r,r�rrr4)rr�rrrr	�&test__convert_None_to_Interface_w_Nonelsz1Test_utils.test__convert_None_to_Interface_w_NonecCs(ddlm}t�}|�||�|k�dS)Nrr�)r,r�r*r4)rr�rrrr	�'test__convert_None_to_Interface_w_otherqsz2Test_utils.test__convert_None_to_Interface_w_othercCsVddl}ddlm}d}|jddkr<|�||�t|��n|�||�t|d��dS)Nr��_normalize_namesstrr��ascii)�sysr,r��version_infor;Zunicode�str)rr�r�ZSTRrrr	�test__normalize_name_strvsz#Test_utils.test__normalize_name_strcCs$ddlm}d}|�||�|�dS)Nrr�Zustr)r,r�r;)rr�ZUSTRrrr	�test__normalize_name_unicodesz'Test_utils.test__normalize_name_unicodecCs6ddlm}dddgit�fD]}|�t||�qdS)Nrr�r:g�?r)r,r�r*rM�	TypeError)rr�rrrr	�test__normalize_name_other�sz%Test_utils.test__normalize_name_otherN)rrrr�r�r�r�r�rrrr	r�js
	r�)�__doc__ZunittestrZTestCaserrrr�r�rr	rnr�rrrr	�<module>s$V:>C