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

��e�6����dZddlZddlmZd�ZGd�d�ZGd�de�ZGd	�d
e�ZGd�de�ZGd
�de�Z	Gd�dej�ZGd�de�ZGd�dej�Z
Gd�de
e�ZGd�dej�ZGd�dee�ZGd�dej�ZGd�dej�ZGd�d e�ZGd!�d"ej�Zy)#zAdapter registry tests
�N)�OptimizationTestMixinc	���ddlm}Gd�d|�}Gd�d|�}Gd�d|�}Gd	�d
||�}Gd�d||�}Gd
�d|�}Gd�d|�}Gd�d|�}Gd�d|�}	|||||||||	f	S)Nr��	Interfacec��eZdZy)�_makeInterfaces.<locals>.IB0N��__name__�
__module__�__qualname__���C/usr/lib/python3/dist-packages/zope/interface/tests/test_adapter.py�IB0r���rrc��eZdZy)�_makeInterfaces.<locals>.IB1Nr	r
rr�IB1rrrrc��eZdZy)�_makeInterfaces.<locals>.IB2Nr	r
rr�IB2rrrrc��eZdZy)�_makeInterfaces.<locals>.IB3Nr	r
rr�IB3r rrrc��eZdZy)�_makeInterfaces.<locals>.IB4Nr	r
rr�IB4r"rrrc��eZdZy)�_makeInterfaces.<locals>.IF0Nr	r
rr�IF0r%rrr c��eZdZy)�_makeInterfaces.<locals>.IF1Nr	r
rr�IF1r"'rrr#c��eZdZy)�_makeInterfaces.<locals>.IR0Nr	r
rr�IR0r%*rrr&c��eZdZy)�_makeInterfaces.<locals>.IR1Nr	r
rr�IR1r(,rrr))�zope.interfacer)
rrrrrrr r#r&r)s
          r�_makeInterfacesr+s���(�
�i�
�
�c�
�
�c�
�
�c�3�
�
�c�3�
�
�i�
�
�c�
�
�i�
�
�c�
���S�#�s�C��c�3�6�6rc�:�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
y)	�CustomDataTypeBaseNc� �|j|S�N��_data��self�names  r�__getitem__zCustomDataTypeBase.__getitem__7s���z�z�$��rc�"�||j|<yr/r0)r3r4�values   r�__setitem__zCustomDataTypeBase.__setitem__:s�� ��
�
�4�rc��|j|=yr/r0r2s  r�__delitem__zCustomDataTypeBase.__delitem__=s���J�J�t�rc�,�t|j�Sr/)�lenr1�r3s r�__len__zCustomDataTypeBase.__len__@s���4�:�:��rc��||jvSr/r0r2s  r�__contains__zCustomDataTypeBase.__contains__Cs���t�z�z�!�!rc�n�||uryt|�t|�k7ry|j|jk(S)NTF)�typer1�r3�others  r�__eq__zCustomDataTypeBase.__eq__Fs2���D�=����;�$�t�*�$���{�{�d�j�j�(�(rc�,�t|j�Sr/)�reprr1r=s r�__repr__zCustomDataTypeBase.__repr__Ns���D�J�J��r)r
rrr1r5r8r:r>r@rErHr
rrr-r-5s*���E� �!���"�)� rr-c��eZdZdd�Zy)�
CustomMappingNc��i|_|r|jj|�|jj|_|jj|_yr/)r1�update�get�itemsrCs  r�__init__zCustomMapping.__init__Rs>����
���J�J���e�$��:�:�>�>����Z�Z�%�%��
rr/�r
rrrOr
rrrJrJQs��&rrJc��eZdZdd�Zy)�CustomSequenceNc��g|_|r|jj|�|jj|_yr/)r1�extend�appendrCs  rrOzCustomSequence.__init__[s/����
���J�J���e�$��j�j�'�'��rr/rPr
rrrRrRZs��(rrRc��eZdZy)�CustomLeafSequenceNr	r
rrrWrWa���rrWc��eZdZy)�CustomProvidedNr	r
rrrZrZdrXrrZc��eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd,d
�Zd,d�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d �Z"d!�Z#d"�Z$d#�Z%d$�Z&d%�Z'd&�Z(d'�Z)d(�Z*d)�Z+d*�Z,d+�Z-y)-�BaseAdapterRegistryTestsNc��ddlm}|S)Nr��BaseAdapterRegistry��zope.interface.adapterr_)r3r_s  r�_getBaseAdapterRegistryz0BaseAdapterRegistryTests._getBaseAdapterRegistryls��>�"�"rc��|j�}Gd�d|�}|jD]!}t|j|t	���#|S)Nc� �eZdZGd�d�Zy)�6BaseAdapterRegistryTests._getTargetClass.<locals>._CUTc�,�eZdZdxZZd�Zd�Zd�Zd�Zy)�BBaseAdapterRegistryTests._getTargetClass.<locals>._CUT.LookupClassr
c��yr/r
)r3�regs  rrOzKBaseAdapterRegistryTests._getTargetClass.<locals>._CUT.LookupClass.__init__us��rc�0�|xj|fz
c_yr/��_changed)r3�origs  r�changedzJBaseAdapterRegistryTests._getTargetClass.<locals>._CUT.LookupClass.changedws���M�M�d�W�,�Mrc�0�|xj|fz
c_yr/)�
_extendors�r3�provideds  r�add_extendorzOBaseAdapterRegistryTests._getTargetClass.<locals>._CUT.LookupClass.add_extendorys���O�O��{�2�Orc�h�t|jD�cgc]	}||k7r|��c}�|_ycc}wr/)�tuplerp)r3rr�xs   r�remove_extendorzRBaseAdapterRegistryTests._getTargetClass.<locals>._CUT.LookupClass.remove_extendor{s3��&+����-?�1�01�X�
�./�-?�'@�D�O��-?s�/N)	r
rrrlrprOrnrsrwr
rr�LookupClassrgss!��(*�*��:��-�3�@rrxN)r
rrrxr
rr�_CUTrers��

@�

@rry)rb�
_delegated�setattrrx�object)r3r_ryr4s    r�_getTargetClassz(BaseAdapterRegistryTests._getTargetClasspsP��"�:�:�<��	@�&�	@�(�2�2�	6�D��D�$�$�d�F�H�5�	6��rc�,�|j��Sr/�r}r=s r�_makeOnez!BaseAdapterRegistryTests._makeOne�s��%�t�#�#�%�'�'rc��tSr/��dictr=s r�_getMappingTypez(BaseAdapterRegistryTests._getMappingType�����rc��tSr/r�r=s r�_getProvidedTypez)BaseAdapterRegistryTests._getProvidedType�r�rc��tSr/)�listr=s r�_getMutableListTypez,BaseAdapterRegistryTests._getMutableListType�r�rc��tSr/)rur=s r�_getLeafSequenceTypez-BaseAdapterRegistryTests._getLeafSequenceType�s���rc��|j�}|�}|jD]2}|jt||�t|j|���4yr/)r}rz�assertIs�getattr�	_v_lookup)r3�CUT�registryr4s    r�test_lookup_delegationz/BaseAdapterRegistryTests.test_lookup_delegation�sN���"�"�$���5���N�N�	V�D��M�M�'�(�D�1�7�8�;M�;M�t�3T�U�	Vrc�\�|j�}|j|jd�y�N�)r��assertEqual�_generation�r3r�s  r�"test__generation_on_first_creationz;BaseAdapterRegistryTests.test__generation_on_first_creation�s#���=�=�?������-�-�q�1rc���|j�}t�}|j|�|j|jd�|j|j
j||f�y�N�)r�r|rnr�r�r�rl)r3r�rms   r�&test__generation_after_calling_changedz?BaseAdapterRegistryTests.test__generation_after_calling_changed�sY���=�=�?���x�����������-�-�q�1�����+�+�4�4�x��6G�Hrc��Gd�d�}|j�}|f|_|j|jd�y)Nc��eZdZy)�QBaseAdapterRegistryTests.test__generation_after_changing___bases__.<locals>._BaseNr	r
rr�_Baser�����rr�r�)r��	__bases__r�r�)r3r�r�s   r�)test__generation_after_changing___bases__zBBaseAdapterRegistryTests.test__generation_after_changing___bases__�s7��	�	��=�=�?��#�X�������-�-�q�1rc���|jt|j�|�|j|j|j	��|j�}|jD]}|j||��|j|jd|��|j|jd|�|jt|j|dz
�d�y�Nrr�)r�r<�	_adapters�assertIsInstancer�r��r3r��expected_order�MT�mappings     r�_check_basic_types_of_adaptersz7BaseAdapterRegistryTests._check_basic_types_of_adapters�s�������X�/�/�0�.�A����h�0�0�$�2J�2J�2L�M�
�
!�
!�
#���)�)�	/�G��!�!�'�2�.�	/�����+�+�A�.���5����h�0�0��3�R�8�����X�/�/���0B�C�D�a�Hrc���|jt|j�|�|j|j|j	��|j�}|jD]}|j||��|ro|j|jd|��|j|jd|�|jt|j|dz
�d�yyr�)r�r<�_subscribersr�r�r�r�s     r�!_check_basic_types_of_subscribersz:BaseAdapterRegistryTests._check_basic_types_of_subscribers�s�������X�2�2�3�^�D����h�3�3�T�5M�5M�5O�P�
�
!�
!�
#���,�,�	/�G��!�!�'�2�.�	/�����X�2�2�1�5�r�t�<��!�!�(�"7�"7��":�B�?����S��!6�!6�~��7I�!J�K�Q�O�rc
�p�t�\	}}}}}}}}}	|j�}
|
j|g|dd�|j|
j	|g|d�d�|j|
j
d�|j
|
�|j�}|j|
jd|||||ddi�i�i��|j�}|j|
j||di��t|
j��}
|j|
|f|ddfg�y)N��A1r�r�)
r+r��registerr��
registeredr�r�r�r�r��	_providedr��allRegistrations)r3rrrrrr r#r&r)r�r��PTr�s              r�
test_registerz&BaseAdapterRegistryTests.test_register�sH��6E�6G�3��S�#�s�C��c�3���=�=�?�����3�%��b�$�/�����,�,�c�U�C��<�d�C�����-�-�q�1��+�+�H�5�
�
!�
!�
#������+�+�A�.�����R��T�
�^���4
�1�	�
�
"�
"�
$������+�+�R���1
�.�	��(�3�3�5�6�
�����
�F����	'
�&�	rc�.�
���
���t�\	�
���
}}}��|j�}|jg�dd�|jg�dd�|j�
g�dd�|j�
g�dd�|j�
g�dd�|j�
g�dd�|j�
�g�dd�|j�
�g�dd�|j�
�g�d	d�|j�
�
g�dd��
���
��fd
�}|j|j||j�|j
����t|j��}|j|d�ddfd�ddf�
f�ddf�
f�ddf�
f�ddf�
f�ddf�
�f�ddf�
�f�ddf�
�f�d	df�
�
f�ddfg
�|j�}|D]}|j|��|j|j|j�|j|j|j�t|_t|_
t|_t |_d
�}	|	|_|j'�|j|j|tt���y)Nr�r��name1�A2�name2�A3�name3�A4�name4c� ��||�|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�rrrrr&r)s  ������r�build_adapterszXBaseAdapterRegistryTests.test_register_multiple_allRegistrations.<locals>.build_adapters�s������� �!%���������R� $�%)�!���R� $�%)�!��	�	�������R���R��J��!���R���W�d�O�!4���W�d�O�!4�!���R���R��J��!����
�
�-$�$�$
r)r�r�r
c�D�|�|n	t�}|j|�|Sr/�rWrU��existing�news  r�addValuezRBaseAdapterRegistryTests.test_register_multiple_allRegistrations.<locals>.addValue1�#��#+�#7�x�=O�=Q�H��O�O�C� ��Or)r+r�r�r�r�r�r��sortedr�r�rJ�_mappingTyperW�_leafSequenceTyperR�
_sequenceTyperZ�
_providedType�_addValueToLeaf�rebuild)r3rr r#r�r�r��	registry2�argsr�rrrrr&r)s          @@@@@@r�'test_register_multiple_allRegistrationsz@BaseAdapterRegistryTests.test_register_multiple_allRegistrations�s����6E�6G�3��S�#�s�C��c�3���=�=�?�����"�c�2�t�,����"�c�7�D�1����3�%��b�$�/����3�%��g�t�4����3�%��b�$�/����3�%��g�t�4����3��*�c�2�t�4����3��*�c�7�D�9����3��*�c�7�D�9����3��*�c�2�t�4�%	�%	�N	
����+�+�'�$�*B�*B�*D�+/�+?�+?�+A�C�	D��H�5�5�7�8�
�����
��b�$��
��g�t�$��V�S�"�d�#��V�S�'�4�(��V�S�"�d�#��V�S�'�4�(��3�Z��b�$�'��3�Z��g�t�,��3�Z��g�t�,��3�Z��b�$�'�&
�	��M�M�O�	��	&�D��I����%�	&�	
����,�,�h�.@�.@�A�����,�,�h�.@�.@�A�!.���%7��"�!/���!/���	�$,�� ���������+�+�'�-� -��	rc	���t�\	}}}}}}}}}	|j�}
|jt�5|
j	|g|t�d�ddd�y#1swYyxYw�Nr�)r+r��assertRaises�
ValueErrorr�r|�r3rrrrrr r#r&r)r�s           r�test_register_with_invalid_namez8BaseAdapterRegistryTests.test_register_with_invalid_name?sc��6E�6G�3��S�#�s�C��c�3���=�=�?��
�
�
�z�
*�	:����s�e�S�&�(�D�9�	:�	:�	:�s�A!�!A*c	��t�\	}}}}}}}}}	|j�}
|
jdg|dd�|
jdg|dd�|jt	|
j
�d�|j
|
j
|j��t|
j��}|j|g�y)Nr�r�r)
r+r�r�r�r<r�r�r�r�r�)r3rrrrrr r#r&r)r�r�s            r�)test_register_with_value_None_unregisterszBBaseAdapterRegistryTests.test_register_with_value_None_unregistersEs���6E�6G�3��S�#�s�C��c�3���=�=�?�����4�&�#�r�4�0����4�&�#�r�4�0�����X�/�/�0�!�4����h�0�0�$�2J�2J�2L�M��(�3�3�5�6�
�����R�(rc
�"�ddlm}t�\	}}}}}}}}	}
|j�}t	�}|jdg|	d|�|j}
|jdg|	d|�|j|j|
�|j|�|j�}|j|jd||||	|d|i�i�i��t|j��}|j||f|	d|fg�y)Nrrr�r�)
r*rr+r�r|r�r�r�r�r�r�r�r�)r3rrrrrrr r#r&r)r��_value�_beforer�r�s                r�test_register_with_same_valuez6BaseAdapterRegistryTests.test_register_with_same_valueOs��,�6E�6G�3��S�#�s�C��c�3���=�=�?��������4�&�#�r�6�2��&�&�����4�&�#�r�6�2�����-�-�w�7��+�+�H�5�
�
!�
!�
#������+�+�A�.���2��R��V��-���
�1
�	��(�3�3�5�6�
�����
�L����	'
�&�	rc���|j�}|j|jdgdd�d�t|j	��}|j|g�y�Nr�)r�r�r�r�r�)r3r�r�s   r�test_registered_emptyz.BaseAdapterRegistryTests.test_registered_emptylsQ���=�=�?������,�,�d�V�T�2�>��E��(�3�3�5�6�
�����R�(rc	��t�\	}}}}}}}}}	|j�}
|
j|gddd�|j|
j	|gdd�d�y�Nr�r�)r+r�r�r�r�r�s           r�test_registered_non_empty_missz7BaseAdapterRegistryTests.test_registered_non_empty_missrs_��6E�6G�3��S�#�s�C��c�3���=�=�?�����3�%��r�4�0�����,�,�c�U�D�"�=�t�Drc��|j�}|jdgddd�|j|jdgdd�d�yr�)r�r�r�r�r�s  r�test_registered_non_empty_hitz6BaseAdapterRegistryTests.test_registered_non_empty_hitxsD���=�=�?�����4�&�$��D�1�����,�,�d�V�T�2�>��Erc���|j�}|jdgdd�|j|jdgdd�d�|jt	|j
�d�y)Nr�r)r��
unregisterr�r�r<r�r�s  r�test_unregister_emptyz.BaseAdapterRegistryTests.test_unregister_empty}s]���=�=�?�����T�F�D�"�-�����,�,�d�V�T�2�>��E�����X�/�/�0�!�4rc
��t�\	}}}}}}}}}	|j�}
|
j|gddd�|
j|gdd�|j	|
j|gdd�d�|j
|
�|j�}|j	|
jd|||d|ddi�i�i��|j�}|j	|
j|ddi��y)Nr�r�r��r+r�r�r�r�r�r�r�r�r�r��
r3rrrrrr r#r&r)r�r�r�s
             r�*test_unregister_non_empty_miss_on_requiredzCBaseAdapterRegistryTests.test_unregister_non_empty_miss_on_required�s	��6E�6G�3��S�#�s�C��c�3���=�=�?�����3�%��r�4�0����S�E�4��,�����,�,�c�U�D�"�=�t�D��+�+�H�5�
�
!�
!�
#������+�+�A�.���R��b�"�d��n���
�1
�	��
"�
"�
$������+�+�R��!�1
�.�	rc
��t�\	}}}}}}}}}	|j�}
|
j|gddd�|
j|gdd�|j	|
j|gdd�d�|j
|
�|j�}|j	|
jd|||d|ddi�i�i��|j�}|j	|
j|ddi��y)Nr�r��nonesuchr�r�r�s
             r�&test_unregister_non_empty_miss_on_namez?BaseAdapterRegistryTests.test_unregister_non_empty_miss_on_name�s	��6E�6G�3��S�#�s�C��c�3���=�=�?�����3�%��r�4�0����S�E�4��4�����,�,�c�U�D�"�=�t�D��+�+�H�5�
�
!�
!�
#������+�+�A�.���R��b�"�d��n���
�1
�	��
"�
"�
$������+�+�R��!�1
�.�	rc	��t�\	}}}}}}}}}	|j�}
t�}t�}|
j|gdd|�|
j	|gdd|�|j|
j
|gdd�|�yr�)r+r�r|r�r�r�r��
r3rrrrrr r#r&r)r�rm�nomatchs
             r�(test_unregister_with_value_not_None_misszABaseAdapterRegistryTests.test_unregister_with_value_not_None_miss�s���6E�6G�3��S�#�s�C��c�3���=�=�?���x���(�����3�%��r�4�0����S�E�4��W�5��
�
�h�)�)�3�%��r�:�D�Arc��t�\	}}}}}}}}}	|j�}
t�}t�}|
j||gdd|�|
j||gdd|�|j	|
d��|j||
jd|�|j||
jd|�|j�}
|j|
jd|
||
||
d|
d|i�i�||
d|
d|i�i�i�i��|j�}|j|
j|ddi��|
j||gdd|�|j||
jd|�|j||
jd|�|j|
jd|
||
||
d|
d|i�i�i�i��|j|
j|ddi��y)Nr���r�r�r�)
r+r�r|r�r��assertInr�r�r�r�r�r��assertNotIn)r3rrrrrr r#r&r)r��one�anotherr�r�s               r�.test_unregister_hit_clears_empty_subcomponentszGBaseAdapterRegistryTests.test_unregister_hit_clears_empty_subcomponents�s-��6E�6G�3��S�#�s�C��c�3���=�=�?���h���(�����3��*�d�B��4����3��*�d�B��8��+�+�H�Q�+�G��
�
�c�8�-�-�a�0��5�6��
�
�c�8�-�-�a�0��5�6�
�
!�
!�
#������+�+�A�.���R��R��r�2�s�)�}� 5�6��R��r�2�w�-�'8� 9�:���
�	1
�		��
"�
"�
$������+�+�R��!�1
�.�	�	���S�#�J��b�'�:��
�
�c�8�-�-�a�0��5�6�����h�0�0��3�C�8�9�����+�+�A�.���R��R��r�2�s�)�}� 5�6���
�1
�	�	
����+�+�R��!�1
�.�	rc��|j�}|jdgdd�|j|jdgdd�d�|j	|d��y)Nr�rr�)r��unsubscriber�r�r�r�s  r�test_unsubscribe_emptyz/BaseAdapterRegistryTests.test_unsubscribe_empty�sU���=�=�?�����d�V�T�2�.�����,�,�d�V�T�2�>��E��.�.�x��.�Jrc��t�\	}}}}}}}}}	|j�}
t�}|
j|gd|�|j	�}|j�}
|j
�}|j|
�|j|
jd|||d|d|
|f�i�i�i��|j|
j|i��|
j|gd|�|jt|
j�d�|j|
j|i��y)Nr�r�r)
r+r�r|�	subscriber�r�r�r�r�r�r�rr<)r3rrrrrr r#r&r)r�rmr�r�r�s               r�test_unsubscribe_hitz-BaseAdapterRegistryTests.test_unsubscribe_hit�s0��6E�6G�3��S�#�s�C��c�3���=�=�?���x�����C�5�$��-�
�
!�
!�
#���%�%�'��
�
"�
"�
$���.�.�x�8�����.�.�q�1�2����b���4�'�
�����7
�4�	�	
����+�+�R��V�4����c�U�D�$�/�����X�2�2�3�Q�7�����+�+�R��V�4rc�(�|j||�y)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)�assertIsNot�r3�leaf1�leaf2s   r�assertLeafIdentityz+BaseAdapterRegistryTests.assertLeafIdentity�s��	
�����&rc���t�\	}}}}}}}}}	|j�}
t�}t�}t�}
t�}|
j|gd|�|
j|gd|�|
j|g||
�|
j|g||�|j	|
d��|j�}|j
�}|j�}|j|
jd|||d|d|||f�i�||d||
|f�i�i�i��|j|
j||di��|
jd||d}|
jd|dd}|
j|gd|�|
j|g||
�|j|
jd|||d|d||f�i�||d||f�i�i�i��|j|
j||di��|
jd||d}|
jd|dd}|j||�|j||�|
j|gd|�|
j|g||�|jt|
j�d�|jt|
j�d�y)Nr�r�r�r�r)r+r�r|rr�r�r�r�r�r�r�rrr<)r3rrrrrr r#r&r)r��first�second�third�fourthr�r�r��
IR0_leaf_orig�
Non_leaf_orig�IR0_leaf_new�Non_leaf_news                      r�test_unsubscribe_after_multiplez8BaseAdapterRegistryTests.test_unsubscribe_after_multiple	s��6E�6G�3��S�#�s�C��c�3���=�=�?�����������������C�5�$��.����C�5�$��/����C�5�#�u�-����C�5�#�v�.��.�.�x��.�J�
�
!�
!�
#���%�%�'��
�
"�
"�
$������.�.�q�1�2����b�"�a����0�1�2��R��Q��v��/�0�1���7
�4�	�	
����+�+�R���1
�.�	�
!�-�-�a�0��5�c�:�2�>�
� �-�-�a�0��5�d�;�B�?�
����c�U�D�%�0����c�U�C��/�����.�.�q�1�2����b�"�a��	�l�+�,��R��Q��y�\�*�+���7
�4�	�	
����+�+�R���1
�.�	� �,�,�Q�/��4�S�9�"�=���,�,�Q�/��4�T�:�2�>�����
�|�<����
�|�<����c�U�D�&�1����c�U�C��0�����X�2�2�3�Q�7�����X�/�/�0�!�4rc��t�\	}}}}}}}}}	|j�}
t�}|
j|g||�|
j|g||�|j	�}|j�}
|j
�}|j|
jd|||||d|
||f�i�i�i��|j|
j||di��|
j|g||�|
j|g||�|jt|
j�d�|j|
j|��y�Nr�r�r�r�r+r�r|rr�r�r�r�r�r�rr<)r3rrrrrr r#r&r)r�rr�r�r�s               r�5test_subscribe_unsubscribe_identical_objects_providedzNBaseAdapterRegistryTests.test_subscribe_unsubscribe_identical_objects_provided=sU��6E�6G�3��S�#�s�C��c�3���=�=�?��������C�5�#�u�-����C�5�#�u�-�
�
!�
!�
#���%�%�'��
�
"�
"�
$������.�.�q�1�2����R��Q��u�~�.�/�0���7
�4�	�
	
����+�+�R���1
�.�	�	���c�U�C��/����c�U�C��/�����X�2�2�3�Q�7�����+�+�R�T�2rc���t�\	}}}}}}}}}	|j�}
t�}t�}|
j|g||�|
j|g||�|j	�}
|j�}|j
�}|j|
jd|
||
||
d|||f�i�i�i��|j|
j||di��|
j|g||�|
j|g||�|jt|
j�d�|j|
j|��yrr)r3rrrrrr r#r&r)r�rrr�r�r�s                r�4test_subscribe_unsubscribe_nonequal_objects_providedzMBaseAdapterRegistryTests.test_subscribe_unsubscribe_nonequal_objects_providedVs\��6E�6G�3��S�#�s�C��c�3���=�=�?�����������C�5�#�u�-����C�5�#�v�.�
�
!�
!�
#���%�%�'��
�
"�
"�
$������.�.�q�1�2����R��Q��v��/�0�1���7
�4�	�
	
����+�+�R���1
�.�	�	���c�U�C��/����c�U�C��0�����X�2�2�3�Q�7�����+�+�R�T�2rc��|j�}|j|jdgdd��t|j	��}|j|g�yr�)r��assertIsNone�
subscribedr��allSubscriptionsr�)r3r�rs   r�test_subscribed_emptyz.BaseAdapterRegistryTests.test_subscribed_emptypsO���=�=�?�����(�-�-�t�f�d�B�?�@��(�3�3�5�6�
�����R�(rc	�F�t�\	}}}}}}}}}	|j�}
|
j|g|d�|j|
j	|g|d��|j|
j	|g|d��|j|
j	|g|d��y)Nr�r�)r+r�rrrr�s           r�test_subscribed_non_empty_missz7BaseAdapterRegistryTests.test_subscribed_non_empty_missvs���6E�6G�3��S�#�s�C��c�3���=�=�?�����C�5�#�t�,����(�-�-�s�e�S�"�=�>����(�-�-�s�e�S�"�=�>����(�-�-�s�e�S�"�=�>rc	��t�\	}}}}}}}}}	|j�}
|
j|g|d�|j|
j	|g|d�d�yr�)r+r�rr�rr�s           r�test_subscribed_non_empty_hitz6BaseAdapterRegistryTests.test_subscribed_non_empty_hit�s]��6E�6G�3��S�#�s�C��c�3���=�=�?�����C�5�#�t�,�����,�,�c�U�C��>��Erc	�Z�t�\	}}}}}}}}}	|j�}
t�}t�}|
j|gd|�|
j|gd|�|j	|
d��|
j|gd�|j
t|
j�d�y)Nr�r�r)	r+r�r|rr�rr�r<r�)
r3rrrrrr r#r&r)r�rrs
             r�&test_unsubscribe_w_None_after_multiplez?BaseAdapterRegistryTests.test_unsubscribe_w_None_after_multiple�s���6E�6G�3��S�#�s�C��c�3���=�=�?�����������C�5�$��.����C�5�$��/��.�.�x��.�J����c�U�D�)�����X�2�2�3�Q�7rc���t�\	}}}}}}}}}	|j�}
|
j|gdd�|j|
d��|
j	|gdd�|jt
|
j�d�|j�}|j�}|j|
jd|||d|d|d�i�i�i��y)Nr�r�r�r�r��r��
r+r�rr�rr�r<r�r�r��
r3rrrrrr r#r&r)r�r�r�s
             r�+test_unsubscribe_non_empty_miss_on_requiredzDBaseAdapterRegistryTests.test_unsubscribe_non_empty_miss_on_required�s���6E�6G�3��S�#�s�C��c�3���=�=�?�����C�5�$��-��.�.�x��.�J����c�U�D�"�-�����X�2�2�3�Q�7�
�
!�
!�
#���%�%�'������.�.�q�1�2����b�"�a��j�)�*���7
�4�	rc���t�\	}}}}}}}}}	|j�}
|
j|gdd�|j|
d��|
j	|gdd�|jt
|
j�d�|j�}|j�}|j|
jd|||d|d|d�i�i�i��y)Nr�r�r�r�r�r�r)r*r+s
             r�(test_unsubscribe_non_empty_miss_on_valuezABaseAdapterRegistryTests.test_unsubscribe_non_empty_miss_on_value�s���6E�6G�3��S�#�s�C��c�3���=�=�?�����C�5�$��-��.�.�x��.�J����c�U�D�$�/�����X�2�2�3�Q�7�
�
!�
!�
#���%�%�'������.�.�q�1�2����b�"�a��j�)�*���7
�4�	rc	��t�\	}}}}}}}}}	|j�}
t�}t�}|
j|gd|�|
j	|gd|�|jt
|
j�d�yr�)r+r�r|rrr�r<r�r�s
             r�)test_unsubscribe_with_value_not_None_misszBBaseAdapterRegistryTests.test_unsubscribe_with_value_not_None_miss�sy��6E�6G�3��S�#�s�C��c�3���=�=�?���x���(�����C�5�$��-����c�U�D�'�2�����X�2�2�3�Q�7rc�&�|jd�y)Nz*Example method, not intended to be called.��failr=s r�_instance_method_notify_targetz7BaseAdapterRegistryTests._instance_method_notify_target�s���	�	�>�?rc	�X�t�\	}}}}}}}}}	|j�}
|jt|
j�d�|
j|gd|j�|
j|gd|j�|jt|
j�d�y�Nr)r+r�r�r<r�rr4rr�s           r� test_unsubscribe_instance_methodz9BaseAdapterRegistryTests.test_unsubscribe_instance_method�s���6E�6G�3��S�#�s�C��c�3���=�=�?������X�2�2�3�Q�7����C�5�$��(K�(K�L����c�U�D�$�*M�*M�N�����X�2�2�3�Q�7rc����
����t�\	���
�}}}��|j�}|jg�d�|jg�d�|j�g�d�|j�g�d�|j�g�d�|j�g�d�|j��g�d�|j��
g�d�|j��
g�d�|j��g�d����
���fd�}|j|j||j�|j
�|j������fd�}|j|j||j����t|j��}|j|d	�dfd	�df�f�df�f�df�f�df�f�df��f�df��
f�df��
f�df��f�dfg
�|j�}|D]}	|j|	��|j|j|j�|j|j|j�t|_
t|_t |_t$|_d
�}
|
|_|j+�|j|j|t tt���y)Nr�r�r�r�c���||�|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��Fr�rrrrr&r)s	   ������r�build_subscribersz\BaseAdapterRegistryTests.test_subscribe_multiple_allRegistrations.<locals>.build_subscribers�s5��������A�t�T�l�O���������R���4��,��!���R���4��,��!��	��	�	�����R���R��D�6��O�!4�!���R���R��D�6��O�!4���R��D�6��O�!4�!���R���R��D�6��O�!4�!����
�
�'!�!�!
r)r�r:r�c���|�d�di�S)N��r
)�Pr&r)s ��r�build_providedzYBaseAdapterRegistryTests.test_subscribe_multiple_allRegistrations.<locals>.build_provideds�����Q��Q���
r)r?r
c�D�|�|n	t�}|j|�|Sr/r�r�s  rr�zSBaseAdapterRegistryTests.test_subscribe_multiple_allRegistrations.<locals>.addValue(r�r)r+r�rr�r�r�r�r�r�r�r�r rJr�rWr�rRr�rZr�r�r�)r3rr r#r�r;r@r�r�r�r�rrrrr&r)s           @@@@@@r�(test_subscribe_multiple_allRegistrationszABaseAdapterRegistryTests.test_subscribe_multiple_allRegistrations�s����6E�6G�3��S�#�s�C��c�3���=�=�?�����2�s�D�)����2�s�D�)����C�5�#�t�,����C�5�#�t�,����C�5�#�t�,����C�5�#�t�,����C��:�s�D�1����C��:�s�D�1����C��:�s�D�1����C��:�s�D�1�"	�"	�H	
����.�.�*�#�7�7�9�#�8�8�:� $� 4� 4� 6��	�	�	
����+�+�'�$�*?�*?�*A�B�	D��H�5�5�7�8�
�����
��d�O�
��d�O��V�S�$���V�S�$���V�S�$���V�S�$���3�Z��d�#��3�Z��d�#��3�Z��d�#��3�Z��d�#�&
�	��M�M�O�	��	'�D��I����&�	'�	
����/�/��1F�1F�G�����,�,�h�.@�.@�A�!.���%7��"�!/���!/���	�$,�� ���������.�.�*�-�1� -��	r)r�).r
rr�maxDiffrbr}r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrrr!r#r%r'r,r.r0r4r7rBr
rrr\r\hs����G�#��$(�����V�2�
I�2�I�	P��4c�J:�)��:)�E�F�
5��,�,B�(�TK�5�*
'�25�h3�23�4)�	?�F�
8�
�
�8�@�8�orr\c�4�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	y)	�#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``.
    c��tSr/)rJr=s rr�z3CustomTypesBaseAdapterRegistryTests._getMappingTypeAs���rc��tSr/)rZr=s rr�z4CustomTypesBaseAdapterRegistryTests._getProvidedTypeD����rc��tSr/)rRr=s rr�z7CustomTypesBaseAdapterRegistryTests._getMutableListTypeGrHrc��tSr/)rWr=s rr�z8CustomTypesBaseAdapterRegistryTests._getLeafSequenceTypeJs��!�!rc�2���ddlm�G��fd�d��}|S)Nrr^c���eZdZW�j�ZW�j�ZW�j�ZW�j�Z
d�Z�fd�Zy)�ZCustomTypesBaseAdapterRegistryTests._getBaseAdapterRegistry.<locals>.CustomAdapterRegistryc�L�|s|j�}|j|�|Sr/)r�rU)r3�existing_leaf_sequence�new_items   rr�zjCustomTypesBaseAdapterRegistryTests._getBaseAdapterRegistry.<locals>.CustomAdapterRegistry._addValueToLeafUs(��-�-1�-C�-C�-E�*�&�-�-�h�7�-�-rc�D���j|||�}||dd||vsJ�|Sr/)�_removeValueFromLeaf)r3rO�	to_remove�without_removedr_s    �rrRzoCustomTypesBaseAdapterRegistryTests._getBaseAdapterRegistry.<locals>.CustomAdapterRegistry._removeValueFromLeaf[s>���"5�"J�"J��*��#��-<�&�q�)� �(>�>�>�>�-�-rN)
r
rrr�r�r�r�r�r�r�r�r�rR)r_r3s��r�CustomAdapterRegistryrMOsF����/�/�1�L� �4�4�6�M� $� 9� 9� ;�� �1�1�3�M�
.�
.rrUr`)r3rUr_s` @rrbz;CustomTypesBaseAdapterRegistryTests._getBaseAdapterRegistryMs���>�	.�$7�	.�*%�$rc�(�|j||�yr/)r�r	s   rrz6CustomTypesBaseAdapterRegistryTests.assertLeafIdentityfs���
�
�e�U�#rN)
r
rr�__doc__r�r�r�r�rbrr
rrrErE8s%������"�%�2$rrEc����eZdZd�ZeZ		dd�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z�fd�Zd�Zd�Zd�Zd�Zd�Z�xZ S)�LookupBaseFallbackTestsc��ddlm}|S)Nr)�LookupBaseFallback)rar[)r3r[s  r�_getFallbackClassz)LookupBaseFallbackTests._getFallbackClassls��=�!�!rc�n������d����d����d��G���fd�d|j��}|�S)Nc��yr/r
�r3�requiredrrr4s    r�	uc_lookupz3LookupBaseFallbackTests._makeOne.<locals>.uc_lookupv���rc��t��r/��NotImplementedError�r3r`rrs   r�uc_lookupAllz6LookupBaseFallbackTests._makeOne.<locals>.uc_lookupAlly���)�+�+rc��t��r/rdrfs   r�uc_subscriptionsz:LookupBaseFallbackTests._makeOne.<locals>.uc_subscriptions|rhrc� ��eZdZW�ZW�ZW�Zy)�1LookupBaseFallbackTests._makeOne.<locals>.DerivedN)r
rr�_uncached_lookup�_uncached_lookupAll�_uncached_subscriptions)rargrjs���r�Derivedrl~s���(��".��&6�#rrpr)r3rargrjrps ``` rr�z LookupBaseFallbackTests._makeOnersJ�����
���
,��#�
,�	7�	7�d�*�*�,�	7��y�rc��d�}|j|��}|jt�5|jddt	��ddd�y#1swYyxYw)Nc�&�|jd�y�NzThis should never be calledr2r_s    r�_lookupzCLookupBaseFallbackTests.test_lookup_w_invalid_name.<locals>._lookup�����I�I�3�4r�ra��A�B)r�r�r��lookupr|�r3rt�lbs   r�test_lookup_w_invalid_namez2LookupBaseFallbackTests.test_lookup_w_invalid_name�sL��	5�
�]�]�W�]�
-��
�
�
�z�
*�	-��I�I�f�c�6�8�,�	-�	-�	-���A�Ac���g��fd�}|j|��}|jddd�}|j|�|j�dg�y)Nc�.���j|||f�yr/�rU�r3r`rrr4�_called_withs    �rrtzDLookupBaseFallbackTests.test_lookup_miss_no_default.<locals>._lookup���������8�T� :�;rrvrwry�C�rwryr�)r�rzrr��r3rtr|�foundr�s    @r�test_lookup_miss_no_defaultz3LookupBaseFallbackTests.test_lookup_miss_no_default�sS�����	<��]�]�W�]�
-���	�	�&�#�s�+�����%� �����(:�';�<rc���g�t�}�fd�}|j|��}|jddd|�}|j||�|j	�dg�y)Nc�.���j|||f�yr/r�r�s    �rrtzCLookupBaseFallbackTests.test_lookup_miss_w_default.<locals>._lookup�r�rrvrwryr�r��r|r�rzr�r��r3�_defaultrtr|r�r�s     @r�test_lookup_miss_w_defaultz2LookupBaseFallbackTests.test_lookup_miss_w_default�s\������8��	<��]�]�W�]�
-���	�	�&�#�s�H�5���
�
�e�X�&�����(:�';�<rc����g�t�t�t�}}}|||g���fd�}|j|��}|jddd�}|j||�|j	�dg�|j	�||g�y)Nc�N���j|||f��jd�Sr6�rU�pop�r3r`rrr4r��_resultss    ��rrtz?LookupBaseFallbackTests.test_lookup_not_cached.<locals>._lookup��&�������8�T� :�;��<�<��?�"rrvrwryr�r�r��	r3�a�b�crtr|r�r�r�s	       @@r�test_lookup_not_cachedz.LookupBaseFallbackTests.test_lookup_not_cached�s�������(�F�H�f�h�a�1���q�!�9��	#��]�]�W�]�
-���	�	�&�#�s�+���
�
�e�Q������(:�';�<�����A�q�6�*rc�@���g�t�t�t�}}}|||g���fd�}|j|��}|jddd�}|jddd�}|j||�|j	�dg�|j	�||g�y)Nc�N���j|||f��jd�Sr6r�r�s    ��rrtz;LookupBaseFallbackTests.test_lookup_cached.<locals>._lookup�r�rrvrwryr�r�r�r�s	       @@r�test_lookup_cachedz*LookupBaseFallbackTests.test_lookup_cached�s�������(�F�H�f�h�a�1���q�!�9��	#��]�]�W�]�
-���	�	�&�#�s�+���	�	�&�#�s�+���
�
�e�Q������(:�';�<�����A�q�6�*rc����g�t�t�t�}}}|||g���fd�}|j|��}|jddd�}|j||�|j	�dg�|j	�||g�y)Nc�N���j|||f��jd�Sr6r�r�s    ��rrtzNLookupBaseFallbackTests.test_lookup_not_cached_multi_required.<locals>._lookup�r�rrv�rx�Dryr��r�ryr�r�r�s	       @@r�%test_lookup_not_cached_multi_requiredz=LookupBaseFallbackTests.test_lookup_not_cached_multi_required�s�������(�F�H�f�h�a�1���q�!�9��	#��]�]�W�]�
-���	�	�*�c�3�/���
�
�e�Q������(>�'?�@�����A�q�6�*rc�@���g�t�t�t�}}}|||g���fd�}|j|��}|jddd�}|jddd�}|j||�|j	�dg�|j	�||g�y)Nc�N���j|||f��jd�Sr6r�r�s    ��rrtzJLookupBaseFallbackTests.test_lookup_cached_multi_required.<locals>._lookup�r�rrvr�ryr�r�r�r�s	       @@r�!test_lookup_cached_multi_requiredz9LookupBaseFallbackTests.test_lookup_cached_multi_required�s�������(�F�H�f�h�a�1���q�!�9��	#��]�]�W�]�
-���	�	�*�c�3�/���	�	�*�c�3�/���
�
�e�Q������(>�'?�@�����A�q�6�*rc�b���g�t�t�t�}}}|||g���fd�}|j|��}|jddd�}|j|�|jddd�}|j	||�|j�ddg�|j�|g�y)Nc�N���j|||f��jd�Sr6r�r�s    ��rrtzMLookupBaseFallbackTests.test_lookup_not_cached_after_changed.<locals>._lookup�r�rrvrwryr�r�)r|r�rzrnr�r�r�s	       @@r�$test_lookup_not_cached_after_changedz<LookupBaseFallbackTests.test_lookup_not_cached_after_changed�s�������(�F�H�f�h�a�1���q�!�9��	#��]�]�W�]�
-���	�	�&�#�s�+��
�
�
�2���	�	�&�#�s�+���
�
�e�Q������,�.@�A�	C�����A�3�'rc��d�}|j|��}|jt�5|jddt	��ddd�y#1swYyxYw)Nc�&�|jd�yrsr2r_s    rrtzDLookupBaseFallbackTests.test_lookup1_w_invalid_name.<locals>._lookup�rurrvrxry)r�r�r��lookup1r|r{s   r�test_lookup1_w_invalid_namez3LookupBaseFallbackTests.test_lookup1_w_invalid_name�sN��	5��]�]�W�]�
-��
�
�
�z�
*�	+��J�J�s�C���*�	+�	+�	+�r~c���g��fd�}|j|��}|jddd�}|j|�|j�dg�y)Nc�.���j|||f�yr/r�r�s    �rrtzELookupBaseFallbackTests.test_lookup1_miss_no_default.<locals>._lookup�r�rrvrxryr�r�)r�r�rr�r�s    @r�test_lookup1_miss_no_defaultz4LookupBaseFallbackTests.test_lookup1_miss_no_default�sS�����	<��]�]�W�]�
-���
�
�3��S�)�����%� �����(:�';�<rc���g�t�}�fd�}|j|��}|jddd|�}|j||�|j	�dg�y)Nc�.���j|||f�yr/r�r�s    �rrtzDLookupBaseFallbackTests.test_lookup1_miss_w_default.<locals>._lookup�r�rrvrxryr�r��r|r�r�r�r�r�s     @r�test_lookup1_miss_w_defaultz3LookupBaseFallbackTests.test_lookup1_miss_w_default�s\������8��	<��]�]�W�]�
-���
�
�3��S�(�3���
�
�e�X�&�����(:�';�<rc�
��g�t�}�fd�}|j|��}|jddd|�}|j||�|jddd|�}|j||�|j	�dg�y)Nc�.���j|||f�yr/r�r�s    �rrtzSLookupBaseFallbackTests.test_lookup1_miss_w_default_negative_cache.<locals>._lookupr�rrvrxryr�r�r�r�s     @r�*test_lookup1_miss_w_default_negative_cachezBLookupBaseFallbackTests.test_lookup1_miss_w_default_negative_caches~������8��	<��]�]�W�]�
-���
�
�3��S�(�3���
�
�e�X�&��
�
�3��S�(�3���
�
�e�X�&�����(:�';�<rc����g�t�t�t�}}}|||g���fd�}|j|��}|jddd�}|j||�|j	�dg�|j	�||g�y)Nc�N���j|||f��jd�Sr6r�r�s    ��rrtz@LookupBaseFallbackTests.test_lookup1_not_cached.<locals>._lookupr�rrvrxryr�r�r�r�s	       @@r�test_lookup1_not_cachedz/LookupBaseFallbackTests.test_lookup1_not_cacheds�������(�F�H�f�h�a�1���q�!�9��	#��]�]�W�]�
-���
�
�3��S�)���
�
�e�Q������(:�';�<�����A�q�6�*rc�@���g�t�t�t�}}}|||g���fd�}|j|��}|jddd�}|jddd�}|j||�|j	�dg�|j	�||g�y)Nc�N���j|||f��jd�Sr6r�r�s    ��rrtz<LookupBaseFallbackTests.test_lookup1_cached.<locals>._lookup!r�rrvrxryr�r�r�r�s	       @@r�test_lookup1_cachedz+LookupBaseFallbackTests.test_lookup1_cacheds�������(�F�H�f�h�a�1���q�!�9��	#��]�]�W�]�
-���
�
�3��S�)���
�
�3��S�)���
�
�e�Q������(:�';�<�����A�q�6�*rc�b���g�t�t�t�}}}|||g���fd�}|j|��}|jddd�}|j|�|jddd�}|j	||�|j�ddg�|j�|g�y)Nc�N���j|||f��jd�Sr6r�r�s    ��rrtzNLookupBaseFallbackTests.test_lookup1_not_cached_after_changed.<locals>._lookup/r�rrvrxryr�r�)r|r�r�rnr�r�r�s	       @@r�%test_lookup1_not_cached_after_changedz=LookupBaseFallbackTests.test_lookup1_not_cached_after_changed+s�������(�F�H�f�h�a�1���q�!�9��	#��]�]�W�]�
-���
�
�3��S�)��
�
�
�2���
�
�3��S�)���
�
�e�Q������,�.@�A�	C�����A�3�'rc���t�t�}}|j�}|jt�5|j	||t��ddd�y#1swYyxYwr/)r|r�r�r��adapter_hook)r3�req�prvr|s    r� test_adapter_hook_w_invalid_namez8LookupBaseFallbackTests.test_adapter_hook_w_invalid_name;sO���8�V�X�S��
�]�]�_��
�
�
�z�
*�	0��O�O�C��f�h�/�	0�	0�	0�s�A�A(c��t�t�}}|j�}|j||d�}|j|�yr�)r|r�r�r)r3r�r�r|r�s     r�!test_adapter_hook_miss_no_defaultz9LookupBaseFallbackTests.test_adapter_hook_miss_no_defaultAs:���8�V�X�S��
�]�]�_������S�"�-�����%� rc��t�t�t�}}}|j�}|j||d|�}|j||�yr�)r|r�r�r�)r3r�r�r�r|r�s      r� test_adapter_hook_miss_w_defaultz8LookupBaseFallbackTests.test_adapter_hook_miss_w_defaultGsB��#�X�v�x���(�S��
�]�]�_������S�"�h�7���
�
�e�X�&rc�����g��fd���fd�}t�t�t�}}}|j|��}|j||d|�}|j||�|j	�|g�y)Nc�(���j|�yr/r���context�_f_called_withs �r�_factoryzTLookupBaseFallbackTests.test_adapter_hook_hit_factory_returns_None.<locals>._factoryOs����!�!�'�*rc����Sr/r
�r3r`rrr4r�s    �rrtzSLookupBaseFallbackTests.test_adapter_hook_hit_factory_returns_None.<locals>._lookupR�����Orrvr��r|r�r�r�r�)	r3rtr�r�r�r|�adaptedr�r�s	       @@r�*test_adapter_hook_hit_factory_returns_NonezBLookupBaseFallbackTests.test_adapter_hook_hit_factory_returns_NoneMsi�����	+�	�#�X�v�x���(�S��
�]�]�W�]�
-���/�/�#�s�C��:���
�
�g�x�(�����#��/rc�
���	�g�t����fd��	�	fd�}t�t�t�}}}|j|��}|j||d|�}|j|��|j	�|g�y)Nc�*���j|��Sr/r��r��_adapterr�s ��rr�zWLookupBaseFallbackTests.test_adapter_hook_hit_factory_returns_adapter.<locals>._factory]�����!�!�'�*��Orc����Sr/r
r�s    �rrtzVLookupBaseFallbackTests.test_adapter_hook_hit_factory_returns_adapter.<locals>._lookup`r�rrvr�r��
r3rtr�r�r�r|r�r�r�r�s
       @@@r�-test_adapter_hook_hit_factory_returns_adapterzELookupBaseFallbackTests.test_adapter_hook_hit_factory_returns_adapterZ�p������8��	�	�#�X�v�x���(�S��
�]�]�W�]�
-���/�/�#�s�C��:���
�
�g�x�(�����#��/rc������g��fd��d�fd�	}t�}t�}|j|��}|j||�}|j	||�|j�|g�y)Nc�*���j|�|Sr/r�r�s �rr�zILookupBaseFallbackTests.test_adapter_hook_super_unwraps.<locals>._factoryjs����!�!�'�*��Nrc����Sr/r
r�s    �rrtzHLookupBaseFallbackTests.test_adapter_hook_super_unwraps.<locals>._lookupmr�rrv)r�)�superr|r�r�r�r�)	r3rtr`rrr|r�r�r��	__class__s	      @@�r�test_adapter_hook_super_unwrapsz7LookupBaseFallbackTests.test_adapter_hook_super_unwrapshs`�����	�	��7���8��
�]�]�W�]�
-���/�/�(�H�5���
�
�g�t�$�����$��0rc�
���	�g�t����fd��	�	fd�}t�t�t�}}}|j|��}|j||d|�}|j|��|j	�|g�y)Nc�*���j|��Sr/r�r�s ��rr�z;LookupBaseFallbackTests.test_queryAdapter.<locals>._factoryyr�rc����Sr/r
r�s    �rrtz:LookupBaseFallbackTests.test_queryAdapter.<locals>._lookup|r�rrvr�)r|r��queryAdapterr�r�r�s
       @@@r�test_queryAdapterz)LookupBaseFallbackTests.test_queryAdaptervr�rc����g�t�t�t�g���fd�}|j|��}|jdd�}|j|t	���|j�dg�y)Nc�@���j||f�t��Sr/�rUru�r3r`rrr�r�s   ��r�
_lookupAllzCLookupBaseFallbackTests.test_lookupAll_uncached.<locals>._lookupAll�� �������8� 4�5���?�"r�rgrxry�rwry�r|r��	lookupAllr�ru�r3r�r|r�r�r�s    @@r�test_lookupAll_uncachedz/LookupBaseFallbackTests.test_lookupAll_uncached�sg������H�f�h���1��	#��]�]�
�]�
3�����S�#�&�������h��0�����
��7rc����g�t�t�t�g���fd�}|j|��}|jdd�}|jdd�}|j|t	���|j�dg�y)Nc�@���j||f�t��Sr/r�r�s   ��rr�zALookupBaseFallbackTests.test_lookupAll_cached.<locals>._lookupAll�r�rr�rxryr�r�r�s    @@r�test_lookupAll_cachedz-LookupBaseFallbackTests.test_lookupAll_cached�sw������H�f�h���1��	#��]�]�
�]�
3�����S�#�&�����S�#�&�������h��0�����
��7rc����g�t�t�t�g���fd�}|j|��}|jdd�}|j|t	���|j�dg�y)Nc�@���j||f�t��Sr/r�r�s   ��r�_subscriptionszKLookupBaseFallbackTests.test_subscriptions_uncached.<locals>._subscriptions�r�r�rjrxryr��r|r��
subscriptionsr�ru�r3r�r|r�r�r�s    @@r�test_subscriptions_uncachedz3LookupBaseFallbackTests.test_subscriptions_uncached�si������H�f�h���1��	#��]�]�N�]�
;��� � ��c�*�������h��0�����
��7rc����g�t�t�t�g���fd�}|j|��}|jdd�}|jdd�}|j|t	���|j�dg�y)Nc�@���j||f�t��Sr/r�r�s   ��rr�zILookupBaseFallbackTests.test_subscriptions_cached.<locals>._subscriptions�r�rr�rxryr�r�rs    @@r�test_subscriptions_cachedz1LookupBaseFallbackTests.test_subscriptions_cached�s{������H�f�h���1��	#��]�]�N�]�
;��� � ��c�*��� � ��c�*�������h��0�����
��7r�NNN)!r
rr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�
__classcell__�r�s@rrYrYjs����"�(�O�48�"&��$-�=�	=�+�+�+�+�(� +�=�	=�=�+�+�(� 0�!�'�0�0�1�0�	8�
8�	8�
8rrYc��eZdZd�Zy)�LookupBaseTestsc��ddlm}|S)Nr)�
LookupBase)rar)r3rs  rr}zLookupBaseTests._getTargetClass�s��5��rN�r
rrr}r
rrr	r	�s��rr	c�L�eZdZd�ZeZ		dd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zy)�VerifyingBaseFallbackTestsc��ddlm}|S)Nr)�VerifyingBaseFallback)rar)r3rs  rr\z,VerifyingBaseFallbackTests._getFallbackClass�s��@�$�$rNc�������d����d����d��G���fd�d|j��}||�}|j|�|S)Nc��t��r/rdr_s    rraz6VerifyingBaseFallbackTests._makeOne.<locals>.uc_lookup�rhrc��t��r/rdrfs   rrgz9VerifyingBaseFallbackTests._makeOne.<locals>.uc_lookupAll�rhrc��t��r/rdrfs   rrjz=VerifyingBaseFallbackTests._makeOne.<locals>.uc_subscriptions�rhrc�2���eZdZW�ZW�ZW�Z�fd�Z�xZS)�4VerifyingBaseFallbackTests._makeOne.<locals>.Derivedc�0��t�|��||_yr/)r�rO�	_registry)r3r�r�s  �rrOz=VerifyingBaseFallbackTests._makeOne.<locals>.Derived.__init__�s����� �"�!)��r)r
rrrmrnrorOr)r�rargrjs@���rrpr�s���(��".��&6�#�
*�
*rrp)r}rn)r3r�rargrjrp�deriveds  ```  rr�z#VerifyingBaseFallbackTests._makeOne�s]�����
,���
,��#�
,�	*�	*�d�*�*�,�	*��(�#������ ��rc�@��Gd�d��G�fd�d�}||�S)Nc��eZdZdZy)�@VerifyingBaseFallbackTests._makeRegistry.<locals>.WithGenerationr�N)r
rrr�r
rr�WithGenerationr�s���Krrc���eZdZ�fd�Zy)�:VerifyingBaseFallbackTests._makeRegistry.<locals>.Registryc�V��t|�D�cgc]	}����c}|_ycc}wr/)�range�ro)r3�depth�irs   �rrOzCVerifyingBaseFallbackTests._makeRegistry.<locals>.Registry.__init__�s���5:�5�\�B��>�+�B����Bs�&NrP)rs�r�Registryr�s	���
Crr%r
)r3r#r%rs   @r�
_makeRegistryz(VerifyingBaseFallbackTests._makeRegistry�s%���	�	�	C�	C����rc�@��	�g�t�t�t�}}}|||g�	��	fd�}|jd�}|j||��}|jddd�}|jddd�}|j	||�|j�dg�|j�	||g�|jdxjdz
c_|jddd�}|j	||�|j�ddg�|j�	|g�y)	Nc�N���j|||f��jd�Sr6r�r�s    ��rrtz7VerifyingBaseFallbackTests.test_lookup.<locals>._lookup�r�rr�rvrwryr�r�r�)r|r&r�rzr�r�r"r��
r3r�r�r�rtrir|r�r�r�s
        @@r�test_lookupz&VerifyingBaseFallbackTests.test_lookup�s������(�F�H�f�h�a�1���q�!�9��	#�� � ��#��
�]�]�3�'�]�
2���	�	�&�#�s�+���	�	�&�#�s�+���
�
�e�Q������(:�';�<�����A�q�6�*����q�	����"���	�	�&�#�s�+���
�
�e�Q������,�.@�A�	C�����A�3�'rc�@��	�g�t�t�t�}}}|||g�	��	fd�}|jd�}|j||��}|jddd�}|jddd�}|j	||�|j�dg�|j�	||g�|jdxjdz
c_|jddd�}|j	||�|j�ddg�|j�	|g�y)	Nc�N���j|||f��jd�Sr6r�r�s    ��rrtz8VerifyingBaseFallbackTests.test_lookup1.<locals>._lookup�r�rr�rvrxryr�r�r�)r|r&r�r�r�r�r"r�r)s
        @@r�test_lookup1z'VerifyingBaseFallbackTests.test_lookup1�s������(�F�H�f�h�a�1���q�!�9��	#�� � ��#��
�]�]�3�'�]�
2���
�
�3��S�)���
�
�3��S�)���
�
�e�Q������(:�';�<�����A�q�6�*����q�	����"���
�
�3��S�)���
�
�e�Q������,�.@�A�	C�����A�3�'rc�,���
��t�t�t�g\�
�}�
fd�}�fd�}�fd�}|||g��fd�}t�t�t�}}}�jd�}	�j|	|��}
|
j||d|�}�j	|�
�|
j||d|�}�j	|�
�|	j
dxjdz
c_|
j||d|�}�j	|��y)	Nc����Sr/r
�r�r�s �r�	_factory1z?VerifyingBaseFallbackTests.test_adapter_hook.<locals>._factory1�����Hrc����Sr/r
�r�r�s �r�	_factory2z?VerifyingBaseFallbackTests.test_adapter_hook.<locals>._factory2r2rc�(���jd�yrsr2�r�r3s �r�	_factory3z?VerifyingBaseFallbackTests.test_adapter_hook.<locals>._factory3�����I�I�3�4rc�&���jd�Sr6�r��r3r`rrr4�
_factoriess    �rrtz=VerifyingBaseFallbackTests.test_adapter_hook.<locals>._lookup�����>�>�!�$�$rr�rvr�r�)r|r&r�r�r�r"r��r3�_cr1r5r8rtr�r�r�rir|r�r=r�r�s`           @@@r�test_adapter_hookz,VerifyingBaseFallbackTests.test_adapter_hook������H�f�h���1���1�b�	�	�	5���I�6�
�	%�#�X�v�x���(�S��� � ��#��
�]�]�3�'�]�
2���/�/�#�s�C��:���
�
�g�q�!��/�/�#�s�C��:���
�
�g�q�!����q�	����"���/�/�#�s�C��:���
�
�g�q�!rc�,���
��t�t�t�g\�
�}�
fd�}�fd�}�fd�}|||g��fd�}t�t�t�}}}�jd�}	�j|	|��}
|
j||d|�}�j	|�
�|
j||d|�}�j	|�
�|	j
dxjdz
c_|
j||d|�}�j	|��y)	Nc����Sr/r
r0s �rr1z?VerifyingBaseFallbackTests.test_queryAdapter.<locals>._factory1$r2rc����Sr/r
r4s �rr5z?VerifyingBaseFallbackTests.test_queryAdapter.<locals>._factory2&r2rc�(���jd�yrsr2r7s �rr8z?VerifyingBaseFallbackTests.test_queryAdapter.<locals>._factory3(r9rc�&���jd�Sr6r;r<s    �rrtz=VerifyingBaseFallbackTests.test_queryAdapter.<locals>._lookup+r>rr�rvr�r�)r|r&r�r�r�r"r�r�r?s`           @@@rr�z,VerifyingBaseFallbackTests.test_queryAdapter"rBrc�&��t�t�t�g}t�t�t�g}||g��fd�}|jd�}|j||��}|jdd�}|j	|t|��|jdd�}|j	|t|��|jdxjdz
c_|jdd�}|j	|t|��y)Nc�8��t�jd��Sr6�rur��r3r`rrr�s   �rr�z=VerifyingBaseFallbackTests.test_lookupAll.<locals>._lookupAll<��������a��)�)rr�r�rxryr�)r|r&r�r�r�rur"r�)r3�
_results_1�
_results_2r�rir|r�r�s       @r�test_lookupAllz)VerifyingBaseFallbackTests.test_lookupAll8s�����h���&�(�3�
��h���&�(�3�
��
�+��	*�� � ��#��
�]�]�3�Z�]�
8�����S�#�&�������j� 1�2����S�#�&�������j� 1�2����q�	����"�����S�#�&�������j� 1�2rc�&��t�t�t�g}t�t�t�g}||g��fd�}|jd�}|j||��}|jdd�}|j	|t|��|jdd�}|j	|t|��|jdxjdz
c_|jdd�}|j	|t|��y)Nc�8��t�jd��Sr6rJrKs   �rr�zEVerifyingBaseFallbackTests.test_subscriptions.<locals>._subscriptionsLrLrr�r�rxryr�)r|r&r�r�r�rur"r�)r3rMrNr�rir|r�r�s       @r�test_subscriptionsz-VerifyingBaseFallbackTests.test_subscriptionsHs�����h���&�(�3�
��h���&�(�3�
��
�+��	*�� � ��#��
�]�]�3��]�
@��� � ��c�*�������j� 1�2�� � ��c�*�������j� 1�2����q�	����"��� � ��c�*�������j� 1�2rr)
r
rrr\r}r�r&r*r-rAr�rOrRr
rrrr�s<��%�(�O�>B�"&��.�(�*(�*"�,"�,3� 3rrc��eZdZd�Zy)�VerifyingBaseTestsc��ddlm}|S)Nr)�
VerifyingBase)rarV)r3rVs  rr}z"VerifyingBaseTests._getTargetClass\s��8��rNrr
rrrTrTYs��rrTc���eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z�fd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d �Z"d!�Z#d"�Z$d#�Z%d$�Z&d%�Z'�xZ(S)&�AdapterLookupBaseTestsc��ddlm}|S)Nr)�AdapterLookupBase)rarZ)r3rZs  rr}z&AdapterLookupBaseTests._getTargetClasscs��<� � rc�.�|j�|�Sr/rr�s  rr�zAdapterLookupBaseTests._makeOnegs��%�t�#�#�%�h�/�/rc�$�Gd�d�}|�S)Nc��eZdZd�Zy)�<AdapterLookupBaseTests._makeSubregistry.<locals>.Subregistryc� �g|_g|_yr/)r�r�r=s rrOzEAdapterLookupBaseTests._makeSubregistry.<locals>.Subregistry.__init__ls��!#���$&��!rNrPr
rr�Subregistryr^ks��
'rr`r
)r3rrr`s   r�_makeSubregistryz'AdapterLookupBaseTests._makeSubregistryjs��	'�	'��}�rc�&�Gd�d�}||�S)Nc��eZdZd�Zy)�6AdapterLookupBaseTests._makeRegistry.<locals>.Registryc� �||_g|_yr/)r�r"rqs  rrOz?AdapterLookupBaseTests._makeRegistry.<locals>.Registry.__init__ss��!)�����rNrPr
rrr%rdrs��
rr%r
)r3rrr%s   rr&z$AdapterLookupBaseTests._makeRegistryqs��	�	���!�!rc�~�|j�}|j|�}|j|ji�yr/)r&r�r�rp)r3r��albs   r�test_ctor_empty_registryz/AdapterLookupBaseTests.test_ctor_empty_registryxs2���%�%�'���m�m�H�%���������,rc���ddlm}ddlm}|d�}|d|f�}|j	||�}|j|�}|j
t|jj��t|||g��|j
|j|||g�|j
|j||g�|j
t|j|�t||g��y�Nrr��InterfaceClass�IFoo�IBar)
r*r�zope.interface.interfacerlr&r�r�r�rp�keys�r3rrlrmrnr�rgs       r�test_ctor_w_registry_providedz4AdapterLookupBaseTests.test_ctor_w_registry_provided}s���,�;��f�%���f�t�g�.���%�%�d�D�1���m�m�H�%��������� 3� 3� 5�6���t�Y� 7�8�	:��������-��d�|�<��������-��v�6��������y� 9�:���t��-�	/rc��Gd�d�}Gd�d|j�|�}|j�}||�}|j|�y)Nc��eZdZd�Zy)�AAdapterLookupBaseTests.test_changed_empty_required.<locals>.Mixinc��yr/r
rCs  rrnzIAdapterLookupBaseTests.test_changed_empty_required.<locals>.Mixin.changed�rbrN�r
rrrnr
rr�Mixinru����
rrxc��eZdZy)�CAdapterLookupBaseTests.test_changed_empty_required.<locals>.DerivedNr	r
rrrpr{�r�rrp)r}r&rn)r3rxrpr�rgs     r�test_changed_empty_requiredz2AdapterLookupBaseTests.test_changed_empty_required�sG��	�	�	�d�*�*�,�e�	��%�%�'���h������C�rc���Gd�d�}Gd�d|j�|�}Gd�d�}|d�}|d�}|j�}||�}d	|j|<d	|j|<|j|�|j	t|j�d
�|j	|jd�|j	|j|�y)Nc��eZdZd�Zy)�=AdapterLookupBaseTests.test_changed_w_required.<locals>.Mixinc��yr/r
rCs  rrnzEAdapterLookupBaseTests.test_changed_w_required.<locals>.Mixin.changed�rbrNrwr
rrrxr�ryrrxc��eZdZy)�?AdapterLookupBaseTests.test_changed_w_required.<locals>.DerivedNr	r
rrrpr��r�rrpc�"�eZdZdZd�Zd�Zd�Zy)�CAdapterLookupBaseTests.test_changed_w_required.<locals>.FauxWeakrefNc��||_yr/��_here)r3�heres  rrOzLAdapterLookupBaseTests.test_changed_w_required.<locals>.FauxWeakref.__init__�s	��!��
rc�"�|jr|SdSr/r�r=s r�__call__zLAdapterLookupBaseTests.test_changed_w_required.<locals>.FauxWeakref.__call__�s��#�z�z�t�3�t�3rc��||_yr/)�_unsub)r3�targets  rrzOAdapterLookupBaseTests.test_changed_w_required.<locals>.FauxWeakref.unsubscribe�s	��$��r)r
rrr�rOr�rr
rr�FauxWeakrefr��s���F�
"�
4�
%rr�FTr�r)r}r&�	_requiredrnr�r<r�)r3rxrpr��goner�r�rgs        r�test_changed_w_requiredz.AdapterLookupBaseTests.test_changed_w_required�s���	�	�	�d�*�*�,�e�	�	%�	%��5�!���4� ���%�%�'���h�����
�
�d����
�
�d�����C������S�]�]�+�Q�/�������d�+�������c�*rc��ddlm}ddlm}|d�}|d|f�}|j	�}|j|�}||g|_|j�|jt|jj��t|||g��|j|j|||g�|j|j||g�|jt|j|�t||g��yrj)r*rrorlr&r�r��init_extendorsr�r�rprprqs       r�)test_init_extendors_after_registry_updatez@AdapterLookupBaseTests.test_init_extendors_after_registry_update�s���,�;��f�%���f�t�g�.���%�%�'���m�m�H�%��"�D�\�������������� 3� 3� 5�6���t�Y� 7�8�	:��������-��d�|�<��������-��v�6��������y� 9�:���t��-�	/rc�,�ddlm}ddlm}|d�}|d|f�}|j	�}|j|�}|j
|�|j
|�|jt|jj��t|||g��|j|j|||g�|j|j||g�|jt|j|�t||g��yrj)r*rrorlr&r�rsr�r�rprprqs       r�test_add_extendorz(AdapterLookupBaseTests.test_add_extendor�s���,�;��f�%���f�t�g�.���%�%�'���m�m�H�%������������������� 3� 3� 5�6���t�Y� 7�8�	:��������-��d�|�<��������-��v�6��������y� 9�:���t��-�	/rc�
�ddlm}ddlm}|d�}|d|f�}|j	||�}|j|�}|j
|�|jt|jj��t|||g��|j|j||g�|j|j||g�|jt|j|�t|g��yrj)r*rrorlr&r�rwr�r�rprprqs       r�test_remove_extendorz+AdapterLookupBaseTests.test_remove_extendor�s���,�;��f�%���f�t�g�.���%�%�d�D�1���m�m�H�%�����D�!�������� 3� 3� 5�6���t�Y� 7�8�	:��������-��v�6��������-��v�6��������y� 9�:�����	)rc�^�ddlm}|d�}|d|f�}|j�}|j|�}|j	|f|�}|j|d�|jt
|j�d�|j|j�|j�y�Nrrkrmrnr�)
rorlr&r�rmr�r<r�r��weakref�r3rlrmrnr�rg�results       r�test__uncached_lookup_empty_roz5AdapterLookupBaseTests.test__uncached_lookup_empty_ro�s���;��f�%���f�t�g�.���%�%�'���m�m�H�%���%�%�t�g�t�4�������&�����S�]�]�+�Q�/��
�
�d�l�l�n�c�m�m�4rc��ddlm}|d�}|d|f�}|j||�}|j�}|jj|�|j
|�}|j|f|�}|j|d�y�Nrrkrmrn)	rorlr&rar"rUr�rmr��r3rlrmrnr��subrrgr�s        r� test__uncached_lookup_order_missz7AdapterLookupBaseTests.test__uncached_lookup_order_miss�s���;��f�%���f�t�g�.���%�%�d�D�1���$�$�&�������4� ��m�m�H�%���%�%�t�g�t�4�������&rc�6�ddlm}|d�}|d|f�}|j�}|j�}iig|_|j
j
|�|j|�}||_|j|f|�}|j|d�yr�)rorlr&rar�r"rUr�r�rmr�r�s        r�$test__uncached_lookup_extendors_missz;AdapterLookupBaseTests.test__uncached_lookup_extendors_miss�s���;��f�%���f�t�g�.���%�%�'���$�$�&���b���������4� ��m�m�H�%������%�%�t�g�t�4�������&rc�j�ddlm}|d�}|d|f�}|d�}|j||�}|j�}t	�}i||d|iiig|_|jj|�|j|�}||_	|j|f|�}	|j|	d�y�Nrrkrmrn�IQuxr��rorlr&rar|r�r"rUr�r�rmr��
r3rlrmrnr�r�r��
irrelevantrgr�s
          r�1test__uncached_lookup_components_miss_wrong_ifacezHAdapterLookupBaseTests.test__uncached_lookup_components_miss_wrong_ifaces���;��f�%���f�t�g�.���f�%���%�%�d�D�1���$�$�&���X�
��
�D�2�z�*��
�
���
	�����4� ��m�m�H�%������%�%�t�g�t�4�������&rc�Z�ddlm}|d�}|d|f�}|j||�}|j�}t	�}i||d|iiig|_|jj|�|j|�}||_	|j|f|�}|j|d�y�Nrrkrmrn�	wrongnamer��	r3rlrmrnr�r�r�rgr�s	         r�0test__uncached_lookup_components_miss_wrong_namezGAdapterLookupBaseTests.test__uncached_lookup_components_miss_wrong_names���;��f�%���f�t�g�.���%�%�d�D�1���$�$�&���H�	��
�D�;�	�2��
�
���
	�����4� ��m�m�H�%������%�%�t�g�t�4�������&rc�Z�ddlm}|d�}|d|f�}|j||�}|j�}t	�}i||d|iiig|_|jj|�|j|�}||_	|j|f|�}|j||�y�Nrrkrmrnr��rorlr&rar|r�r"rUr�r�rmr�)	r3rlrmrnr�r��	_expectedrgr�s	         r� test__uncached_lookup_simple_hitz7AdapterLookupBaseTests.test__uncached_lookup_simple_hit*s���;��f�%���f�t�g�.���%�%�d�D�1���$�$�&���H�	��
�D�2�y�/�*�+�
���	�����4� ��m�m�H�%������%�%�t�g�t�4���
�
�f�i�(rc��ddlm}|d�}|d|f�}|j||�}|j�}t	�}i||d|iiig|_|jj|�|j|�}||_	|j|f|�}|j|f|�}	|j||�|j|	|�yr�r�)
r3rlrmrnr�r�r�rgr��result2s
          r�"test__uncached_lookup_repeated_hitz9AdapterLookupBaseTests.test__uncached_lookup_repeated_hit;s���;��f�%���f�t�g�.���%�%�d�D�1���$�$�&���H�	��
�D�2�y�/�*�+�
���	�����4� ��m�m�H�%������%�%�t�g�t�4���&�&��w��5���
�
�f�i�(��
�
�g�y�)rc��ddlm}ddlm}|d�}|d|f�}||�Gd�d��}|�}|j	�}|j�}iig|_|jj|�|j|�}	|	j|	_|	|_t�}
|	j|f||
��}|j||
�y)	Nr��implementerrkrmrnc��eZdZy)�FAdapterLookupBaseTests.test_queryMultiAdaptor_lookup_miss.<locals>.FooNr	r
rr�Foor�S���rr���default)�zope.interface.declarationsr�rorlr&rar�r"rUr�rmrzr�r|�queryMultiAdapterr�)r3r�rlrmrnr��foor�r�rgr�r�s            r�"test_queryMultiAdaptor_lookup_missz9AdapterLookupBaseTests.test_queryMultiAdaptor_lookup_missNs���;�;��f�%���f�t�g�.��	�T�	�	�	�
�	��e���%�%�'���$�$�&����
���	�����4� ��m�m�H�%���)�)��
�����8���&�&��v�t�X�&�F���
�
�f�h�'rc�����ddlm}ddlm}|d��|j	�}|j|���j�_��fd�}|j||d��y)Nrrk)�MissingSomeAttrsrmc�*���j|f��Sr/)r�)�obrmrgs ��r�testzVAdapterLookupBaseTests.test_queryMultiAdapter_errors_on_attribute_access.<locals>.testrs����(�(�����
rr�)�expected_missing)	rorl�zope.interface.testsr�r&r�rmrz�test_raises)r3rlr�r�r�rmrgs     @@r�1test_queryMultiAdapter_errors_on_attribute_accesszHAdapterLookupBaseTests.test_queryMultiAdapter_errors_on_attribute_accessesZ���
	<�9��f�%���%�%�'���m�m�H�%���)�)��
�	�	�$�$�T�4�+�$�Nrc���ddlm}ddlm}|d�}|d|f�}||�Gd�d��}|�}|j	||�}|j�}t
�}	g��fd�}
i||d	|
iiig|_|jj|�|j|�}|j|_||_
t
�}|j|f||�
�}
|j|
|�|j!�|g�y)Nrr�rkrmrnc��eZdZy)�GAdapterLookupBaseTests.test_queryMultiAdaptor_factory_miss.<locals>.FooNr	r
rrr�r�r�rr�c�(���j|�yr/r�)r�r�s �rr�zLAdapterLookupBaseTests.test_queryMultiAdaptor_factory_miss.<locals>._factory�s�������(rr�r��r�r�rorlr&rar|r�r"rUr�rmrzr�r�r�r�)r3r�rlrmrnr�r�r�r�r�r�rgr�r�r�s              @r�#test_queryMultiAdaptor_factory_missz:AdapterLookupBaseTests.test_queryMultiAdaptor_factory_misszs
���;�;��f�%���f�t�g�.��	�T�	�	�	�
�	��e���%�%�d�D�1���$�$�&���H�	���	)�
�
�D�2�x�.�)�*�
���	�����4� ��m�m�H�%���)�)��
�����8���&�&��v�t�X�&�F���
�
�f�h�'������u�-rc��
��ddlm}ddlm}|d�}|d|f�}||�Gd�d��}|�}|j	||�}|j�}t
��g�
�
�fd�}	i||d	|	iiig|_|jj|�|j|�}
|
j|
_|
|_
t
�}|
j|f||�
�}|j|��|j!�
|g�y)Nrr�rkrmrnc��eZdZy)�FAdapterLookupBaseTests.test_queryMultiAdaptor_factory_hit.<locals>.FooNr	r
rrr�r��r�rr�c�*���j|��Sr/r�)r�r�r�s ��rr�zKAdapterLookupBaseTests.test_queryMultiAdaptor_factory_hit.<locals>._factory�s�������(��rr�r�r�)r3r�rlrmrnr�r�r�r�r�rgr�r�r�r�s             @@r�"test_queryMultiAdaptor_factory_hitz9AdapterLookupBaseTests.test_queryMultiAdaptor_factory_hit�s
���;�;��f�%���f�t�g�.��	�T�	�	�	�
�	��e���%�%�d�D�1���$�$�&���H�	���	�
�
�D�2�x�.�)�*�
���	�����4� ��m�m�H�%���)�)��
�����8���&�&��v�t�X�&�F���
�
�f�i�(������u�-rc�����|j|j��}�fd�}d��||_t�ddt�g}|j	|d�}|j||dd|f�y)Nc����Sr/r
)r��factorys �rrzzKAdapterLookupBaseTests.test_queryMultiAdapter_super_unwraps.<locals>.lookup�s����Nrc��|Sr/r
)r�s rr�zLAdapterLookupBaseTests.test_queryMultiAdapter_super_unwraps.<locals>.factory�s���Kr�*�abc)r�r&rzr�r�r�)r3rgrz�objectsr�r�r�s     @�r�$test_queryMultiAdapter_super_unwrapsz;AdapterLookupBaseTests.test_queryMultiAdapter_super_unwraps�sy����m�m�D�.�.�0�1��	�	���
�
�G����G�	
���&�&�w��5����������	"
�	rc�^�ddlm}|d�}|d|f�}|j�}|j|�}|j	|f|�}|j|d�|jt
|j�d�|j|j�|j�y)Nrrkrmrnr
r�)
rorlr&r�rnr�r<r�r�r�r�s       r�!test__uncached_lookupAll_empty_roz8AdapterLookupBaseTests.test__uncached_lookupAll_empty_ro�s���;��f�%���f�t�g�.���%�%�'���m�m�H�%���(�(�$��$�7�������$�����S�]�]�+�Q�/��
�
�d�l�l�n�c�m�m�4rc�(�ddlm}|d�}|d|f�}|j||�}|j�}|jj|�|j
|�}||_|j|f|�}|j|d�y�Nrrkrmrnr
)
rorlr&rar"rUr�r�rnr�r�s        r�#test__uncached_lookupAll_order_missz:AdapterLookupBaseTests.test__uncached_lookupAll_order_miss�s���;��f�%���f�t�g�.���%�%�d�D�1���$�$�&�������4� ��m�m�H�%������(�(�$��$�7�������$rc�6�ddlm}|d�}|d|f�}|j�}|j�}iig|_|j
j
|�|j|�}||_|j|f|�}|j|d�yr�)rorlr&rar�r"rUr�r�rnr�r�s        r�'test__uncached_lookupAll_extendors_missz>AdapterLookupBaseTests.test__uncached_lookupAll_extendors_miss�s���;��f�%���f�t�g�.���%�%�'���$�$�&���b���������4� ��m�m�H�%������(�(�$��$�7�������$rc�j�ddlm}|d�}|d|f�}|d�}|j||�}|j�}t	�}i||d|iiig|_|jj|�|j|�}||_	|j|f|�}	|j|	d�y)Nrrkrmrnr�r�r
)rorlr&rar|r�r"rUr�r�rnr�r�s
          r�(test__uncached_lookupAll_components_missz?AdapterLookupBaseTests.test__uncached_lookupAll_components_miss�s���;��f�%���f�t�g�.���f�%���%�%�d�D�1���$�$�&���X�
��
�D�2�z�*�+�,�
���	�����4� ��m�m�H�%������(�(�$��$�7�������$rc��ddlm}|d�}|d|f�}|j||�}|j�}t	�}t	�}i||||d�iig|_|jj|�|j|�}||_	|j|f|�}	|jt|	�d|fd|fg�y�Nrrkrmrn)r��namedr�r�)
rorlr&rar|r�r"rUr�r�rnr�r��
r3rlrmrnr�r�r��_namedrgr�s
          r�#test__uncached_lookupAll_simple_hitz:AdapterLookupBaseTests.test__uncached_lookupAll_simple_hits���;��f�%���f�t�g�.���%�%�d�D�1���$�$�&���H�	�����
�D�y�6�:�;�<�
���	�����4� ��m�m�H�%������(�(�$��$�7��������2�y�/�G�V�;L�)M�Nrc��ddlm}|d�}|d|f�}|j||�}|j�}t	�}t	�}i||||d�iig|_|jj|�|j|�}|j|_
||_|j|f|�}	|jt|	�ddg�yr�)rorlr&rar|r�r"rUr�rnr�r��namesr�r�r�s
          r�
test_namesz!AdapterLookupBaseTests.test_namess���;��f�%���f�t�g�.���%�%�d�D�1���$�$�&���H�	�����
�D�y�6�:�;�<�
���	�����4� ��m�m�H�%���/�/��
�������D�7�D�)��������"�g��7rc�^�ddlm}|d�}|d|f�}|j�}|j|�}|j	|f|�}|j|g�|jt
|j�d�|j|j�|j�yr�)
rorlr&r�ror�r<r�r�r�r�s       r�%test__uncached_subscriptions_empty_roz<AdapterLookupBaseTests.test__uncached_subscriptions_empty_ro&s���;��f�%���f�t�g�.���%�%�'���m�m�H�%���,�,�d�W�d�;�������$�����S�]�]�+�Q�/��
�
�d�l�l�n�c�m�m�4rc�(�ddlm}|d�}|d|f�}|j||�}|j�}|jj|�|j
|�}||_|j|f|�}|j|g�yr�)
rorlr&rar"rUr�r�ror�r�s        r�'test__uncached_subscriptions_order_missz>AdapterLookupBaseTests.test__uncached_subscriptions_order_miss1s���;��f�%���f�t�g�.���%�%�d�D�1���$�$�&�������4� ��m�m�H�%������,�,�d�W�d�;�������$rc�6�ddlm}|d�}|d|f�}|j�}|j�}iig|_|j
j
|�|j|�}||_|j|f|�}|j|g�yr�)rorlr&rar�r"rUr�r�ror�r�s        r�+test__uncached_subscriptions_extendors_misszBAdapterLookupBaseTests.test__uncached_subscriptions_extendors_miss=s���;��f�%���f�t�g�.���%�%�'���$�$�&����H��������4� ��m�m�H�%������,�,�d�W�d�;�������$rc�j�ddlm}|d�}|d|f�}|d�}|j||�}|j�}t	�}i||d|iiig|_|jj|�|j|�}||_	|j|f|�}	|j|	g�yr��rorlr&rar|r�r"rUr�r�ror�r�s
          r�8test__uncached_subscriptions_components_miss_wrong_ifacezOAdapterLookupBaseTests.test__uncached_subscriptions_components_miss_wrong_ifaceJs���;��f�%���f�t�g�.���f�%���%�%�d�D�1���$�$�&���X�
��
�D�2�z�*�+�,�
���	�����4� ��m�m�H�%������,�,�d�W�d�;�������$rc�Z�ddlm}|d�}|d|f�}|j||�}|j�}t	�}i||d|iiig|_|jj|�|j|�}||_	|j|f|�}|j|g�yr�r�r�s	         r�7test__uncached_subscriptions_components_miss_wrong_namezNAdapterLookupBaseTests.test__uncached_subscriptions_components_miss_wrong_name\s���;��f�%���f�t�g�.���%�%�d�D�1���$�$�&���H�	��
�D�;�	�2�3�4�
���	�����4� ��m�m�H�%������,�,�d�W�d�;�������$rc��ddlm}|d�}|d|f�}|j||�}|j�}Gd�d�}|�|�}}i||d||fiiig|_|j
j
|�|j|�}	|	|_|	j|f|�}
|jt|
�t||g��y)Nrrkrmrnc��eZdZd�Zy)�KAdapterLookupBaseTests.test__uncached_subscriptions_simple_hit.<locals>.Fooc��y)NTr
rCs  r�__lt__zRAdapterLookupBaseTests.test__uncached_subscriptions_simple_hit.<locals>.Foo.__lt__ts��rN)r
rrrr
rrr�rss��
rr�r�)rorlr&rar�r"rUr�r�ror�r�)r3rlrmrnr�r�r��_exp1�_exp2rgr�s           r�'test__uncached_subscriptions_simple_hitz>AdapterLookupBaseTests.test__uncached_subscriptions_simple_hitms���;��f�%���f�t�g�.���%�%�d�D�1���$�$�&��	�	��u�c�e�u���
�D�2��u�~�.�/�0�
���	�����4� ��m�m�H�%������,�,�d�W�d�;������������)?�@rc��
�ddlm}ddlm}|d�}|d|f�}||�Gd�d��}|�}|j	||�}|j	||�}|j�}i�
�
fd�}	�
fd	�}
i|dd
|	|
fiiig|_|jj|�|j|�}|j|_||_|j|fd�}|j|d�|j�
|g|gd��y)
Nrr�rkrmrnc��eZdZy)�@AdapterLookupBaseTests.test_subscribers_wo_provided.<locals>.FooNr	r
rrr�r
�r�rr�c�H���jdg�j|�y�Nr1��
setdefaultrU�r��_calleds �rr1zFAdapterLookupBaseTests.test_subscribers_wo_provided.<locals>._factory1��������{�B�/�6�6�w�?rc�H���jdg�j|�y�Nr5r
rs �rr5zFAdapterLookupBaseTests.test_subscribers_wo_provided.<locals>._factory2�rrr�r
)r1r5)r�r�rorlr&rar�r"rUr�ror�r��subscribersr�)r3r�rlrmrnr�r�r�r�r1r5rgr�rs             @r�test_subscribers_wo_providedz3AdapterLookupBaseTests.test_subscribers_wo_provided�s���;�;��f�%���f�t�g�.��	�T�	�	�	�
�	��e���%�%�d�D�1���%�%�d�D�1���$�$�&����	@�	@�
�
�D�2�	�9�5�6�7�8�
���	�����4� ��m�m�H�%���7�7���������#���.�������$�������S�E�"J�Krc�b����ddlm}ddlm}|d�}|d|f�}||�Gd�d��}|�}|j	||�}|j	||�}|j�}i�t
�t
�c����fd�}	��fd	�}
�fd
�}i||d|	|
|fiiig|_|jj|�|j|�}|j|_||_
|j|f|�}
|j|
��g�|j�|g|g|gd��y)
Nrr�rkrmrnc��eZdZy)�?AdapterLookupBaseTests.test_subscribers_w_provided.<locals>.FooNr	r
rrr�r�r�rr�c�J���jdg�j|��Srr
)r�rrs ��rr1zEAdapterLookupBaseTests.test_subscribers_w_provided.<locals>._factory1��#������{�B�/�6�6�w�?��Lrc�J���jdg�j|��Srr
)r�rrs ��rr5zEAdapterLookupBaseTests.test_subscribers_w_provided.<locals>._factory2�rrc�H���jdg�j|�y)N�_side_effect_onlyr
rs �rrzMAdapterLookupBaseTests.test_subscribers_w_provided.<locals>._side_effect_only�s������2�B�7�>�>�w�Grr�)r1r5r)r�r�rorlr&rar|r�r"rUr�ror�r�rr�)r3r�rlrmrnr�r�r�r�r1r5rrgr�rrrs              @@@r�test_subscribers_w_providedz2AdapterLookupBaseTests.test_subscribers_w_provided�sD���;�;��f�%���f�t�g�.��	�T�	�	�	�
�	��e���%�%�d�D�1���%�%�d�D�1���$�$�&�����x�����u�	�	�	H�
�
�D�2�	�9�6G�H�I�J�K�
���	�����4� ��m�m�H�%���7�7���������#���.������%���0�����(+�u�(+�u�03�u��	r))r
rrr}r�rar&rhrrr|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�rrrrrs@rrXrXas����!�0��"�-�
/�	�+�4/� /� 
)�"	5�	'�'�'�&'�&)�"*�&(�.O�*.�:.�:�.	5�
%�%�%�$O�$8�&	5�
%�%�%�$%�"A�(L�:%rrXc��eZdZd�Zd�Zd�Zy)�VerifyingAdapterRegistryTestsc��ddlm}|S)Nr)�VerifyingAdapterRegistry)rar")r3r"s  rr}z-VerifyingAdapterRegistryTests._getTargetClass�s��C�'�'rc�.�|j�|i|��Sr/r)r3r��kws   rr�z&VerifyingAdapterRegistryTests._makeOne�s��%�t�#�#�%�t�2�r�2�2rc�N�ddlm}ddlm}|j	�}|||�y)Nr)�verifyObject)�IAdapterRegistry)�zope.interface.verifyr&�zope.interface.interfacesr'r�)r3r&r'r�s    r�,test_verify_object_provides_IAdapterRegistryzJVerifyingAdapterRegistryTests.test_verify_object_provides_IAdapterRegistry�s��6�>��=�=�?���%�x�0rN)r
rrr}r�r*r
rrr r �s��(�3�1rr c�6�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	y)	�AdapterRegistryTestsc��ddlm}|S)Nr)�AdapterRegistry)rar.)r3r.s  rr}z$AdapterRegistryTests._getTargetClass�s��:��rc�n�|j�}|jt|j�d�yr6)r�r�r<�_v_subregistries)r3�ars  r�test_ctor_no_basesz'AdapterRegistryTests.test_ctor_no_bases�s(��
�]�]�_������R�0�0�1�1�5rc��|j�}|j|g�}|jt|j�d�|jt|j�d�|j	||j�yr�)r�r�r<r0r�)r3�base�subs   r�test_ctor_w_basesz&AdapterRegistryTests.test_ctor_w_bases�sg���}�}����m�m�T�F�#������S�1�1�2�A�6�����T�2�2�3�Q�7��
�
�c�4�0�0�1rc�D�|j�}|j�}|j|g�}|g|_|jt|j�d�|jt|j�d�|j||j�yr��r�r�r�r<r0r��r3�before�afterr5s    r�,test__setBases_removing_existing_subregistryzAAdapterRegistryTests.test__setBases_removing_existing_subregistry�s{��������
�
����m�m�V�H�%�����
�����V�4�4�5�q�9�����U�3�3�4�a�8��
�
�c�5�1�1�2rc��|j�}|j�}|j�}|j|g�}|jdj|�|g|_|j	t|j�d�|j	t|j�d�|j||j�y)Nr�rr�)r��__dict__rUr�r�r<r0r�)r3r:�strayr;r5s     r�test__setBases_wo_stray_entryz2AdapterRegistryTests.test__setBases_wo_stray_entry�s���������
�
����
�
����m�m�V�H�%�����[�!�(�(��/����
�����V�4�4�5�q�9�����U�3�3�4�a�8��
�
�c�5�1�1�2rc�~�|j�}|j�}|j|g�}||g|_|jt|j�d�|jt|j�d�|j||j�|j||j�yr�r8r9s    r�*test__setBases_w_existing_entry_continuingz?AdapterRegistryTests.test__setBases_w_existing_entry_continuings���������
�
����m�m�V�H�%������
�����V�4�4�5�q�9�����U�3�3�4�a�8��
�
�c�6�2�2�3��
�
�c�5�1�1�2rc�>�|j�}Gd�d�}|�|�}}|j|�|j|�t�}|j|�|j	|j
|�|j	|j
|�y)Nc��eZdZdZd�Zy)�BAdapterRegistryTests.test_changed_w_subregistries.<locals>.DerivedNc��||_yr/rk)r3�originally_changeds  rrnzJAdapterRegistryTests.test_changed_w_subregistries.<locals>.Derived.changeds	�� 2��
r)r
rrrlrnr
rrrprEs���H�
3rrp)r��_addSubregistryr|rnr�rl)r3r4rp�derived1�derived2rms      r�test_changed_w_subregistriesz1AdapterRegistryTests.test_changed_w_subregistriess}���}�}���	3�	3�%�Y��	�(�����X�&����X�&��x�����T���
�
�h�'�'��.��
�
�h�'�'��.rN)
r
rrr}r2r6r<r@rBrKr
rrr,r,�s%���6�2�3�	3�3�/rr,c�*�eZdZd�Zd�Zd�Zd�Zd�Zy)�
Test_utilsc�L�ddlm}ddlm}|j	|d�|�y)Nr��_convert_None_to_Interfacer)rarProrr�)r3rPrs   r�&test__convert_None_to_Interface_w_Nonez1Test_utils.test__convert_None_to_Interface_w_Nones��E�6��
�
�0��6�	�Brc�T�ddlm}t�}|j||�|�y)NrrO)rarPr|r�)r3rPrDs   r�'test__convert_None_to_Interface_w_otherz2Test_utils.test__convert_None_to_Interface_w_other"s ��E�����
�
�0��7��?rc��ddlm}d}d}||�}|j||�|j|t	|��y)Nr��_normalize_namesstr�str)rarVr�r�rB)r3rV�STR�UNICODE�norms     r�test__normalize_name_strz#Test_utils.test__normalize_name_str's=��:������s�#������w�'����d�D��M�2rc�D�ddlm}d}|j||�|�y)NrrU�ustr)rarVr�)r3rV�USTRs   r�test__normalize_name_unicodez'Test_utils.test__normalize_name_unicode/s��:��������.��5rc�h�ddlm}dddgit�fD]}|jt||��y)NrrUr�g�?r
)rarVr|r��	TypeError)r3rVrDs   r�test__normalize_name_otherz%Test_utils.test__normalize_name_other5s7��:���R��R���1�	A�E����i��%�@�	ArN)r
rrrQrSr[r_rbr
rrrMrMs��C�
@�
3�6�ArrM)rW�unittestr�rr+r-rJrRrWrZ�TestCaser\rErYr	rrTrXr r,rMr
rr�<module>res����6�
7�< � �8&�&�&�(�'�(�	��	�	�]�	�M�x�0�0�M�`/$�*B�/$�dF8�h�/�/�F8�R
�-�+��[3��!2�!2�[3�|�3�.��b	�X�.�.�b	�J1�H�$5�$5�1�*=/�8�=/�@A��"�"�Ar