%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3/dist-packages/zope/interface/tests/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3/dist-packages/zope/interface/tests/__pycache__/test_declarations.cpython-312.pyc

�

��e�@��8�dZddlZddlmZddlmZddlmZGd�d�ZGd�d	ej�Z	Gd
�dej�Z
Gd�d
e
�ZGd�de
�ZGd�deej�Z
Gd�dej�ZGd�dee�ZGd�d�ZGd�deej�ZGd�deej�ZGd�de�ZGd�dej�ZGd �d!e�ZGd"�d#e�ZGd$�d%ej�ZGd&�d'e�ZGd(�d)ej�ZGd*�d+ej�ZGd,�d-ej�ZGd.�d/ej�ZGd0�d1ej�ZGd2�d3ej�ZGd4�d5ee�ZGd6�d7ej�Z Gd8�d9e �Z!Gd:�d;ej�Z"Gd<�d=ej�Z#Gd>�d?ej�Z$Gd@�dAej�Z%GdB�dCej�Z&GdD�dEe&e�Z'GdF�dGej�Z(GdH�dIe(e�Z)GdJ�dKej�Z*GdL�dMe*e�Z+GdN�dO�Z,GdP�dQ�Z-y)Rz@Test the new API for making and checking interface declarations
�N)�OptimizationTestMixin)�MissingSomeAttrs)�!NameAndModuleComparisonTestsMixinc��eZdZ	dd�Zy)�_Py3ClassAdvicec���ddl}|jd��5}|j�	t|||�|r|j	d�		ddd�y#t
$rYddd�ywxYw#1swYyxYw)NrT)�recordzDidn't raise TypeErrorF)�warnings�catch_warnings�
resetwarnings�exec�fail�	TypeError)�self�code�globs�locs�fails_under_py3kr
�logs       �H/usr/lib/python3/dist-packages/zope/interface/tests/test_declarations.py�_run_generated_codez#_Py3ClassAdvice._run_generated_codes���	�
�
$�
$�D�
$�
1�
	�S��"�"�$�
8��T�5�$�'�$��I�I�6�7��
	�
	��
�
��
	�
	�

��
	�
	�s-�A+�
A�A+�	A(�A+�'A(�(A+�+A4N)T)�__name__�
__module__�__qualname__r��rrrs��.2�rrc��eZdZd�Zd�Zd�Zy)�
NamedTestsc�r�ddlm}|d�Gd�d��}|j|jd�y)Nr��named�fooc��eZdZy)�"NamedTests.test_class.<locals>.FooN�rrrrrr�Foor$2���rr&��zope.interface.declarationsr!�assertEqual�__component_name__)rr!r&s   r�
test_classzNamedTests.test_class/s8��5�	�u��	�	�
�	�	
����/�/��7rc�d�ddlm}|d�d��}|j|jd�y)Nrr r"c��t���N��NotImplementedError)�os r�doFooz'NamedTests.test_function.<locals>.doFoo;s��%�'�'rr()rr!r3s   r�
test_functionzNamedTests.test_function8s3��5�	�u��	(�
�	(�	
����1�1�5�9rc��ddlm}Gd�d�}|�}|d�|�|j|jd�y)Nrr c��eZdZy)�%NamedTests.test_instance.<locals>.FooNr%rrrr&r7D���rr&r"r()rr!r&r"s    r�
test_instancezNamedTests.test_instanceAs:��5�	�	��e����e��S������/�/��7rN)rrrr,r4r9rrrrr-s��8�:�8rrc�H�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zy)�EmptyDeclarationTestsc��ddlm}|�S�Nr)�Declaration�r)r>�rr>s  r�	_getEmptyzEmptyDeclarationTests._getEmptyPs
��;��}�rc�Z�|j�}|jt|�g�yr/)rAr*�list�r�decls  r�test___iter___emptyz)EmptyDeclarationTests.test___iter___emptyTs"���~�~�������d��R�(rc��ddlm}|j�}|jt	|j��|g�y�Nr��	Interface)�zope.interface.interfacerJrAr*rC�	flattened�rrJrEs   r�test_flattened_emptyz*EmptyDeclarationTests.test_flattened_emptyXs/��6��~�~�������d�n�n�.�/�)��=rc�T�ddlm}|j�}|j||�yrH)rKrJrA�assertNotInrMs   r�test___contains___emptyz-EmptyDeclarationTests.test___contains___empty]s!��6��~�~�������D�)rc��ddlm}|j�}|j|j	|��|j|j	|d���y)NrrIT��strict)rKrJrA�
assertTrue�extendsrMs   r�test_extends_emptyz(EmptyDeclarationTests.test_extends_emptybs?��6��~�~���������Y�/�0�������Y�t��<�=rc�z�|j�}t|j��}|j|g�yr/)rArC�
interfacesr*)rrE�ls   r�test_interfaces_emptyz+EmptyDeclarationTests.test_interfaces_emptyhs/���~�~�������"�#������B�rc�l�ddlm}|j�}|j|j||f�yrH)rKrJrAr*�__sro__rMs   r�
test___sro___z#EmptyDeclarationTests.test___sro___ms*��6��~�~����������i�'9�:rc�j�ddlm}|j�}|j|j|f�yrH)rKrJrAr*�__iro__rMs   r�
test___iro___z#EmptyDeclarationTests.test___iro___rs'��6��~�~���������	�|�4rc���|j�}|j|jd��|j|jdd�d�|j	|j
�y)N�attr�abc�def)rA�assertIsNone�getr*�assertFalse�_v_attrsrDs  r�test_getzEmptyDeclarationTests.test_getwsT���~�~������$�(�(�6�*�+�������%��/��7�	
������'rc��|j�}t�|_|j|�|j	|j�yr/)rA�objectri�changedrhrDs  r� test_changed_w_existing__v_attrsz6EmptyDeclarationTests.test_changed_w_existing__v_attrss5���~�~������
����T��������'rN)
rrrrArFrNrQrWr[r^rarjrnrrrr;r;Ls4���)�>�
*�
>� �
;�
5�
(�(rr;c��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�Zd�Zd�Zy)�DeclarationTestsc��ddlm}|Sr=r?r@s  r�_getTargetClassz DeclarationTests._getTargetClass����;��rc�.�|j�|i|��Sr/�rr�r�args�kws   r�_makeOnezDeclarationTests._makeOne����%�t�#�#�%�t�2�r�2�2rc�n�|j�}|jt|j�g�yr/)ryr*rC�	__bases__rDs  r�test_ctor_no_basesz#DeclarationTests.test_ctor_no_bases�s&���}�}�������d�n�n�-�r�2rc��ddlm}|d�}|j|�}|jt	|j
�|g�y�Nr��InterfaceClass�IFoo)rKr�ryr*rCr|�rr�r�rEs    r�test_ctor_w_interface_in_basesz/DeclarationTests.test_ctor_w_interface_in_bases�s8��;��f�%���}�}�T�"������d�n�n�-��v�6rc��ddlm}|�}|j|�}|jt	|j
�|g�y�Nr��
Implements)r)r�ryr*rCr|)rr��implrEs    r�test_ctor_w_implements_in_basesz0DeclarationTests.test_ctor_w_implements_in_bases�s5��:��|���}�}�T�"������d�n�n�-��v�6rc�|�|j�}|j|�|j|j�yr/)ryrmrfrirDs  r�!test_changed_wo_existing__v_attrsz2DeclarationTests.test_changed_wo_existing__v_attrs�s+���}�}������T�����$�-�-�(rc�H�|j�}|j||�yr/)ryrPrDs  r�test___contains__w_selfz(DeclarationTests.test___contains__w_self�s���}�}�������t�$rc�d�ddlm}|d�}|j�}|j||�yr)rKr�ryrPr�s    r�"test___contains__w_unrelated_ifacez3DeclarationTests.test___contains__w_unrelated_iface�s*��;��f�%���}�}�������t�$rc�f�ddlm}|d�}|j|�}|j||�yr)rKr�ry�assertInr�s    r�!test___contains__w_base_interfacez2DeclarationTests.test___contains__w_base_interface�s+��;��f�%���}�}�T�"���
�
�d�D�!rc�z�ddlm}|d�}|j|�}|jt	|�|g�yr�rKr�ryr*rCr�s    r�test___iter___single_basez*DeclarationTests.test___iter___single_base�s3��;��f�%���}�}�T�"������d��d�V�,rc��ddlm}|d�}|d�}|j||�}|jt	|�||g�y�Nrr�r��IBarr��rr�r�r�rEs     r�test___iter___multiple_basesz-DeclarationTests.test___iter___multiple_bases�sA��;��f�%���f�%���}�}�T�4�(������d��d�D�\�2rc��ddlm}|d�}|d|f�}|j|�}|jt	|�|g�yr�r�r�s     r�test___iter___inheritancez*DeclarationTests.test___iter___inheritance�sA��;��f�%���f�t�g�.���}�}�T�"������d��d�V�,rc��ddlm}|d�}|d�}|j|||f�}|jt	|�||g�yr�r�r�s     r�'test___iter___w_nested_sequence_overlapz8DeclarationTests.test___iter___w_nested_sequence_overlap�sE��;��f�%���f�%���}�}�T�D�$�<�0������d��d�D�\�2rc��ddlm}ddlm}|d�}|j|�}|j	t|j
��||g�y)NrrIr�r��rKrJr�ryr*rCrL)rrJr�r�rEs     r�test_flattened_single_basez+DeclarationTests.test_flattened_single_base�sA��6�;��f�%���}�}�T�"������d�n�n�.�/�$�	�1B�Crc��ddlm}ddlm}|d�}|d�}|j||�}|j	t|j
��|||g�y�NrrIr�r�r�r��rrJr�r�r�rEs      r�test_flattened_multiple_basesz.DeclarationTests.test_flattened_multiple_bases�sO��6�;��f�%���f�%���}�}�T�4�(������d�n�n�.�/�$��i�1H�Irc��ddlm}ddlm}|d�}|d|f�}|j|�}|j	t|j
��|||g�yr�r�r�s      r�test_flattened_inheritancez+DeclarationTests.test_flattened_inheritance�sQ��6�;��f�%���f�t�g�.���}�}�T�"������d�n�n�.�/�$��i�1H�Irc��ddlm}ddlm}|d�}|d�}|j|||f�}|j	t|j
��|||g�yr�r�r�s      r�(test_flattened_w_nested_sequence_overlapz9DeclarationTests.test_flattened_w_nested_sequence_overlap�sU��6�;��f�%���f�%��
�}�}�T�D�$�<�0������d�n�n�.�/�$��i�1H�Irc���ddlm}|d�}|d�}|j|�}||z
}|j||j	��|jt
|�|g�yr��rKr�ry�assertIsInstancerrr*rC�rr�r�r��before�afters      r� test___sub___unrelated_interfacez1DeclarationTests.test___sub___unrelated_interface�s_��;��f�%���f�%�����t�$����
�����e�T�%9�%9�%;�<�����e��t�f�-rc��ddlm}|d�}|j|�}||z
}|jt	|�g�yrr�)rr�r�r�r�s     r�test___sub___related_interfacez/DeclarationTests.test___sub___related_interface�s:��;��f�%�����t�$����
������e��b�)rc��ddlm}|d�}|d|f�}|j|�}||z
}|jt	|�g�yr�r�r�s      r�-test___sub___related_interface_by_inheritancez>DeclarationTests.test___sub___related_interface_by_inheritancesH��;��f�%���f�t�g�.�����t�$����
������e��b�)rc���ddlm}|d�}|d�}|j|�}||z}|j||j	��|jt
|�||g�yr�r�r�s      r� test___add___unrelated_interfacez1DeclarationTests.test___add___unrelated_interfacesa��;��f�%���f�%�����t�$����
�����e�T�%9�%9�%;�<�����e��t�T�l�3rc���ddlm}|d�}|d�}|d�}|j||�}|j||�}||z}|jt	|�|||g�y)Nrr�r�r��IBazr�)rr�r�r�r�r��otherr�s        r�test___add___related_interfacez/DeclarationTests.test___add___related_interfacesg��;��f�%���f�%���f�%�����t�T�*���
�
�d�D�)����������e��t�T�4�&8�9rc��ddlm}ddlm}ddlm}ddlm}|d�}|d|f�}||jjd�5|j|�}||z}ddd�|jj|||f�|j|j||f�|jt|�||g�y#1swY�dxYw)	NrrIr���	C3Setting��ro�IBase�IDerivedT)�zope.interfacerJrKr��zope.interface.tests.test_ror�r��C3�
STRICT_IROryr*r`r|rC)	rrJr�r�r�r�r��baser�s	         r�"test___add___overlapping_interfacez3DeclarationTests.test___add___overlapping_interfaces���	-�;�:�%��w�'��!�*�u�h�7��
�r�u�u�'�'��
.�	$��=�=��'�D��8�O�E�	$�	
�������5�)�(D�E�������8�U�*;�<�����e��x��&7�8�
	$�	$�s�C�Cc���ddlm}ddlm}ddlm}ddlm}ddlm}Gd�d|�}Gd	�d
|�}||�Gd�d��}||jjd
�5||�|z}	ddd�|j	j|	|||f�|j|	j||f�|jt|	�||g�y#1swY�exYw)NrrI��
implementedBy��implementerr�r�c��eZdZy)�PDeclarationTests.test___add___overlapping_interface_implementedBy.<locals>.IBaseNr%rrrr�r�?r8rr�c��eZdZy)�SDeclarationTests.test___add___overlapping_interface_implementedBy.<locals>.IDerivedNr%rrrr�r�Br8rr�c��eZdZy)�ODeclarationTests.test___add___overlapping_interface_implementedBy.<locals>.BaseNr%rrr�Baser�Er'rr�T)
r�rJr�r�r�r�r�r�r�r*r]r|rC)
rrJr�r�r�r�r�r�r�r�s
          r�0test___add___overlapping_interface_implementedByzADeclarationTests.test___add___overlapping_interface_implementedBy4s���
	-�0�.�:�%�	�I�	�	�u�	�
�U�	�	�	�
�	��r�u�u�'�'��
.�	3�!�$�'�(�2�E�	3�	
��������%��(K�L�������8�U�*;�<�����e��x��&7�8�	3�	3�s�'C�C N)rrrrrryr}r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrprp�s~���3�3�7�7�)�
%�%�"�-�3�-�3�D�J�J�J�.�*�*�4�:�9�,9rrpc�N�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
y)
�TestImmutableDeclarationc��ddlm}|S)Nr)�_ImmutableDeclaration)r)r�)rr�s  rrrz(TestImmutableDeclaration._getTargetClassSs��E�$�$rc��ddlm}|S)Nr)�_empty)r)r�)rr�s  rrAz"TestImmutableDeclaration._getEmptyWs
��6��
rc��ddl}|j|j|j���}|j	||j��y)Nr)�pickle�loads�dumpsrA�assertIs)rr��copieds   r�test_picklez$TestImmutableDeclaration.test_pickle[s8������f�l�l�4�>�>�+;�<�=���
�
�f�d�n�n�.�/rc�j�|j|j��|j��yr/)r�rrrA�rs r�test_singletonz'TestImmutableDeclaration.test_singleton`s)���
�
�"�D� � �"�$��N�N��	
rc�X�|j|j�jd�y)Nr)r*rAr|r�s r�
test__bases__z&TestImmutableDeclaration.test__bases__fs��������)�3�3�R�8rc���|j�}d|_|j|j�jd�|jt�5d|_ddd�y#1swYyxYw)Nr)�)rAr|r*�assertRaisesr)r�emptys  r�test_change__bases__z-TestImmutableDeclaration.test_change__bases__is\����� �����������)�3�3�R�8�
�
�
�y�
)�	#�"�E�O�	#�	#�	#�s�A(�(A1c��|j�}|j}|ji|�d|d<|ji|j�y)N�r�)rA�
dependentsr*)rr��depss   r�test_dependentsz(TestImmutableDeclaration.test_dependentsqsH����� ����������T�"���Q������U�-�-�.rc�B�|j�jd�yr/)rArmr�s r�test_changedz%TestImmutableDeclaration.test_changedys������ � ��&rc� �|j|j�j|��|j|j�j|d���|j|j�j|d���y)NTrSF)rhrArVr�s r�test_extends_always_falsez2TestImmutableDeclaration.test_extends_always_false}sl��������)�1�1�$�7�8�������)�1�1�$�t�1�D�E�������)�1�1�$�u�1�E�Frc��|j|j�jd��|j|j�jdd�d�y)N�name�*)rfrArgr*r�s r�test_get_always_defaultz0TestImmutableDeclaration.test_get_always_default�sF�����$�.�.�*�.�.�v�6�7�������)�-�-�f�b�9�2�>rc��|j�}|j|ji�d|jd<|j|ji�|j|j	d��ix}|_d|d<|j|ji�|j|j	d��y)Nr�rc)rAr*rirfrg)rrE�attrss   r�test_v_attrsz%TestImmutableDeclaration.test_v_attrs�s����~�~����������+� "��
�
�f���������+����$�(�(�6�*�+� "�"���
���f�
��������+����$�(�(�6�*�+rN)rrrrrrAr�r�r�r�r�r�r�r�r�rrrr�r�Qs:��%��0�

�9�#�/�'�G�
?�,rr�c�H�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zy)�TestImplementsc��ddlm}|Sr�)r)r�)rr�s  rrrzTestImplements._getTargetClass����:��rc�.�|j�|i|��Sr/rurvs   rryzTestImplements._makeOne�rzrc�2�ddlm}Gd�d�}||�S)Nrr�c��eZdZy)�+TestImplements._makeOneToCompare.<locals>.ANr%rrr�Ar�r8rr�r)r�)rr�rs   r�_makeOneToComparez TestImplements._makeOneToCompare�s��=�	�	��Q��rc��|j�}|j|jd�|j|jd�|j|jd�|jt|j�g�y)Nr�?)ryr*�inherit�declaredrrCr|�rr�s  rr}z!TestImplements.test_ctor_no_bases�sb���}�}���������t�,��������+��������,�����d�n�n�-�r�2rc�h�|j�}d|_|jt|�d�y)N�TestingzclassImplements(Testing))ryrr*�reprrs  r�
test___repr__zTestImplements.test___repr__�s)���}�}���!��
�����d��%?�@rc�t�ddlm}|j�}|j|j	�|df�y)Nrr�r/)r)r�ryr*�
__reduce__)rr�r�s   r�test___reduce__zTestImplements.test___reduce__�s,��=��}�}���������*�]�G�,D�Erc�t�ddlm}Gd�d�}Gd�d�}ddlm}|d�}|j	||�||��|j	t||��t||���|j
||�dk�|j
d||�kD�|j
||�||�k�|j
||�|kD�|j
||�||�k�|j
||�|k\�|j
||�|k7�y)	Nrr�c��eZdZy)�#TestImplements.test_sort.<locals>.ANr%rrrrr�r8rrc��eZdZy)�#TestImplements.test_sort.<locals>.BNr%rrr�Br�r8rrr�r�)r)r�rKr�r*�hashrU)rr�rrr�r�s      r�	test_sortzTestImplements.test_sort�s��=�	�	�	�	�;��f�%������q�)�=��+;�<�����m�A�.�/��m�A�6F�1G�H����
�a�(�4�/�0�����}�Q�/�/�0����
�a�(�=��+;�;�<����
�a�(�4�/�0����
�a�(�M�!�,<�<�=����
�a�(�D�0�1����
�a�(�D�0�1rc���Gd�d�}ddlm}Gd�d�}Gd�d�}||�}||�}||�}|j||k(�|j||k7�|j||k7�|j||k(�|j||k(�|j||k7�|j||k7�|j||k7�|j||k7�y)	Nc�$�eZdZd�Zd�Zd�Zd�Zy)�1TestImplements.test_proxy_equality.<locals>.Proxyc��||_yr/��_wrapped)r�wrappeds  r�__init__z:TestImplements.test_proxy_equality.<locals>.Proxy.__init__�s	�� '��
rc��t��r/r0�rr�s  r�__getattr__z=TestImplements.test_proxy_equality.<locals>.Proxy.__getattr__����)�+�+rc� �|j|k(Sr/r �rr�s  r�__eq__z8TestImplements.test_proxy_equality.<locals>.Proxy.__eq__�����}�}��-�-rc� �|j|k7Sr/r r)s  r�__ne__z8TestImplements.test_proxy_equality.<locals>.Proxy.__ne__�r+rN)rrrr#r&r*r-rrr�Proxyr�s��
(�
,�
.�
.rr.rr�c��eZdZy)�-TestImplements.test_proxy_equality.<locals>.ANr%rrrrr0�r8rrc��eZdZy)�-TestImplements.test_proxy_equality.<locals>.BNr%rrrrr2�r8rr)r)r�rUrh)rr.r�rr�implementedByA�implementedByB�proxys        r�test_proxy_equalityz"TestImplements.test_proxy_equality�s���	.�	.�	>�	�	�	�	�'�q�)��&�q�)���n�%��	
����.�8�9�����.�8�9�����.�8�9������/�0�����%�/�0�����.�0�1�����5�0�1������/�0�����%�/�0rc�h�|j�}|j|j�|jd|j�d|_|jd|j�|j
d�|j|j�|jd|j�y)N�_super_cacher�)ryrfr8rP�__dict__r�rmrs  r� test_changed_deletes_super_cachez/TestImplements.test_changed_deletes_super_cache�s����}�}������$�+�+�,��������7�����
�
�n�d�m�m�4����T�����$�+�+�,��������7rc�"�|j�}|j|j�|jd|j�|jd�|j|j�|jd|j�y)Nr8)ryrfr8rPr9rmrs  r�%test_changed_does_not_add_super_cachez4TestImplements.test_changed_does_not_add_super_cache�si���}�}������$�+�+�,��������7����T�����$�+�+�,��������7rN)
rrrrrryrr}rrrr6r:r<rrrr�r��s7���3� �3�A�
F�
2�&&1�P
8�8rr�c���eZdZd�ZeZd�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zd
�Zd�Zd�Zd�Z�fd�Z�fd�Z�fd�Z�fd�Z�fd�Z�fd�Z�xZS)�Test_implementedByFallbackc��ddlm}|S)Nr)�implementedByFallback)r)r@)rr@s  rrrz*Test_implementedByFallback._getTargetClass	s��E�$�$rc�.�|j�|i|��Sr/rurvs   r�_callFUTz#Test_implementedByFallback._callFUTrzrc��Gd�d�}|�}d|_|jt|j|��g�y)Nc��eZdZdZy)�]Test_implementedByFallback.test_dictless_wo_existing_Implements_wo_registrations.<locals>.Foo��__implemented__N�rrr�	__slots__rrrr&rE���,�Irr&)rGr*rCrB�rr&r"s   r�5test_dictless_wo_existing_Implements_wo_registrationszPTest_implementedByFallback.test_dictless_wo_existing_Implements_wo_registrationss9��	-�	-��e��"�������d�m�m�C�0�1�2�6rc�h�Gd�d�}|�}|jt|j|�y)Nc�0�eZdZd�Zd�Zeee�Zd�Zy)�hTest_implementedByFallback.test_dictless_wo_existing_Implements_cant_assign___implemented__.<locals>.Fooc��t��r/r0r�s r�	_get_implzrTest_implementedByFallback.test_dictless_wo_existing_Implements_cant_assign___implemented__.<locals>.Foo._get_implr'rc��t�r/)r)r�vals  r�	_set_implzrTest_implementedByFallback.test_dictless_wo_existing_Implements_cant_assign___implemented__.<locals>.Foo._set_impls���rc��t��r/r0r�s r�__call__zqTest_implementedByFallback.test_dictless_wo_existing_Implements_cant_assign___implemented__.<locals>.Foo.__call__!s��)�+�+rN)rrrrQrT�propertyrGrVrrrr&rOs��
,�
 �&�y�)�<�O�
,rr&�r�rrBrKs   r�@test_dictless_wo_existing_Implements_cant_assign___implemented__z[Test_implementedByFallback.test_dictless_wo_existing_Implements_cant_assign___implemented__s+��	,�	,��e�����)�T�]�]�C�8rc���ddlm}Gd�d�}|�}d|_t�}t	|d�5}|||<|j|j
|�|u�ddd�y#1swYyxYw)Nr��declarationsc��eZdZdZy)�\Test_implementedByFallback.test_dictless_wo_existing_Implements_w_registrations.<locals>.FoorFNrHrrrr&r^)rJrr&�#BuiltinImplementationSpecifications)r�r\rGrl�_MonkeyDictrUrB)rr\r&r"�reg�specss      r�4test_dictless_wo_existing_Implements_w_registrationszOTest_implementedByFallback.test_dictless_wo_existing_Implements_w_registrations'sn��/�	-�	-��e��"����h��
��>�@�	7�CH��E�#�J��O�O�D�M�M�#�.�#�5�6�	7�	7�	7�s�(A&�&A/c��ddlm}|�}Gd�d�}|�}||_|j|j	|�|u�y)Nrr�c��eZdZdZy)�KTest_implementedByFallback.test_dictless_w_existing_Implements.<locals>.FoorFNrHrrrr&rf6rJrr&)r)r�rGrUrB)rr�r�r&r"s     r�#test_dictless_w_existing_Implementsz>Test_implementedByFallback.test_dictless_w_existing_Implements3s?��:��|��	-�	-��e��"�������
�
�c�*�d�2�3rc��ddlm}Gd�d�}|�}|d�}|f|_|jt	|j|��|g�y)Nrr�c��eZdZdZy)�OTest_implementedByFallback.test_dictless_w_existing_not_Implements.<locals>.FoorFNrHrrrr&rj>rJrr&r�)rKr�rGr*rCrB)rr�r&r"r�s     r�'test_dictless_w_existing_not_ImplementszBTest_implementedByFallback.test_dictless_w_existing_not_Implements<sJ��;�	-�	-��e���f�%��#�g�������d�m�m�C�0�1�D�6�:rc�|��ddlm}|��G�fd�d�}|j|j|��u�y)Nrr�c���eZdZW�Zy)�JTest_implementedByFallback.test_w_existing_attr_as_Implements.<locals>.FooN�rrrrG�r�s�rr&rnH����"�Orr&�r)r�rUrB�rr�r&r�s   @r�"test_w_existing_attr_as_Implementsz=Test_implementedByFallback.test_w_existing_attr_as_ImplementsE�1���:��|��	#�	#�����
�
�c�*�d�2�3rc� �ddlm}ddlm}t	|d�5}|jt
|jt��g�|jt
|jt��g�|jt
|jt��g�tttfD]B}||}|j||�|jt|�d|j�d���D	ddd�y#1swYyxYw)Nrr[r�r_zclassImplements(�))
r�r\r)r�r`r*rCrB�tuple�dictr�rr)rr\r�rb�typ�specs      r�test_builtins_added_to_cachez7Test_implementedByFallback.test_builtins_added_to_cacheLs���/�:�
��>�@�
	4�CH����T�$�-�-��"6�7��<����T�$�-�-��"5�6��;����T�$�-�-��"5�6��;��t�T�*�
4���S�z���%�%�d�J�7�� � ��d��$'�L�L�"3�4�
4�
	4�
	4�
	4�s�C!D�D
c��ddlm}t�t�t�}}}t|d�5}||t<||t
<||t<|j|jt�|u�|j|jt
�|u�|j|jt�|u�ddd�y#1swYyxYw)Nrr[r_)	r�r\rlr`rxrCryrUrB)rr\�t_spec�l_spec�d_specrbs      r�test_builtins_w_existing_cachez9Test_implementedByFallback.test_builtins_w_existing_cache[s���/�!'��6�8�V�X����
��>�@�	;�CH�!�E�%�L� �E�$�K� �E�$�K��O�O�D�M�M�%�0�F�:�;��O�O�D�M�M�$�/�6�9�:��O�O�D�M�M�$�/�6�9�:�	;�	;�	;�s�BC�Cc�l�Gd�d�}|jt|j|��g�y)Nc��eZdZy)�ITest_implementedByFallback.test_oldstyle_class_no_assertions.<locals>.FooNr%rrrr&r�ir8rr&�r*rCrB�rr&s  r�!test_oldstyle_class_no_assertionsz<Test_implementedByFallback.test_oldstyle_class_no_assertionsg�*��	�	�����d�m�m�C�0�1�2�6rc�l�Gd�d�}|jt|j|��g�y)Nc��eZdZy)�:Test_implementedByFallback.test_no_assertions.<locals>.FooNr%rrrr&r�or8rr&r�r�s  r�test_no_assertionsz-Test_implementedByFallback.test_no_assertionsmr�rc�h�Gd�d�}|�}|jt|j|�y)Nc��eZdZdZy)�HTest_implementedByFallback.test_w_None_no_bases_not_factory.<locals>.FooNrorrrr&r�t���"�Orr&rXrKs   r� test_w_None_no_bases_not_factoryz;Test_implementedByFallback.test_w_None_no_bases_not_factoryss)��	#�	#��e�����)�T�]�]�C�8rc�z�ddlm}Gd�d�}|�}d|_|j|�}|j	|jd�|j|j|�|j|j|�|j|j|�|jd|j�y)Nr)�objectSpecificationDescriptorc��eZdZdZd�Zy)�FTest_implementedByFallback.test_w_None_no_bases_w_factory.<locals>.FooNc��t��r/r0r�s rrVzOTest_implementedByFallback.test_w_None_no_bases_w_factory.<locals>.Foo.__call__}r'r)rrrrGrVrrrr&r�{s��"�O�
,rr&r"z*zope.interface.tests.test_declarations.foo�__provides__)r)r�rrBr*r�r
rG�__providedBy__rPr9)rr�r&r"r{s     r�test_w_None_no_bases_w_factoryz9Test_implementedByFallback.test_w_None_no_bases_w_factoryys���M�	,�	,�
�e������}�}�S�!��������E�	G��
�
�d�l�l�C�(��
�
�c�)�)�4�0��
�
�c�(�(�*G�H��������6rc��ddlm}Gd�d�}|j|�}|j|jd�|j|j|�|j|j|�|j|j|�|j|j|�|j|j|j�y)Nr��
ClassProvidesc��eZdZdZy)�DTest_implementedByFallback.test_w_None_no_bases_w_class.<locals>.FooNrorrrr&r��r�rr&z*zope.interface.tests.test_declarations.Foo)r)r�rBr*rr�r
rGr�r�r�)rr�r&r{s    r�test_w_None_no_bases_w_classz7Test_implementedByFallback.test_w_None_no_bases_w_class�s���=�	#�	#��}�}�S�!��������E�	G��
�
�d�l�l�C�(��
�
�c�)�)�4�0����c�0�0�-�@����c�.�.�
�>�����)�)�3�+=�+=�>rc�|��ddlm}|��G�fd�d�}|j|j|��u�y)Nrr�c���eZdZW�Zy)�BTest_implementedByFallback.test_w_existing_Implements.<locals>.FooNrorps�rr&r��rqrr&rrrss   @r�test_w_existing_Implementsz5Test_implementedByFallback.test_w_existing_Implements�rurc�f��ddlm}ddlm}Gd�d|�}Gd�d|�}||�Gd�d	��}||�Gd
�d|��}|j	t|j
|��||g�t||�}|j	t|j
|��|g�y)NrrIr�c��eZdZy)�STest_implementedByFallback.test_super_when_base_implements_interface.<locals>.IBaseNr%rrrr�r��r8rr�c��eZdZy)�VTest_implementedByFallback.test_super_when_base_implements_interface.<locals>.IDerivedNr%rrrr�r��r8rr�c��eZdZy)�RTest_implementedByFallback.test_super_when_base_implements_interface.<locals>.BaseNr%rrrr�r��r'rr�c��eZdZy)�UTest_implementedByFallback.test_super_when_base_implements_interface.<locals>.DerivedNr%rrr�Derivedr��r'rr��r�rJr)r�r*rCrB�super�	rrJr�r�r�r�r��sup�	__class__s	        �r�)test_super_when_base_implements_interfacezDTest_implementedByFallback.test_super_when_base_implements_interface�s����,�;�	�I�	�	�u�	�
�U�	�	�	�
�	�
�X�	�	�d�	�
�	�	
����d�m�m�G�4�5��%�7H�I��G�W�%������d�m�m�C�0�1�E�7�;rc���ddlm}ddlm}Gd�d|�}Gd�d|�}||�Gd�d	��}Gd
�d|�}Gd�d
|�}||�Gd�d||��}|j	t|j
|��||g�t||�}	|j	t|j
|	��|g�y)NrrIr�c��eZdZy)�[Test_implementedByFallback.test_super_when_base_implements_interface_diamond.<locals>.IBaseNr%rrrr�r��r8rr�c��eZdZy)�^Test_implementedByFallback.test_super_when_base_implements_interface_diamond.<locals>.IDerivedNr%rrrr�r��r8rr�c��eZdZy)�ZTest_implementedByFallback.test_super_when_base_implements_interface_diamond.<locals>.BaseNr%rrrr�r��r'rr�c��eZdZy)�\Test_implementedByFallback.test_super_when_base_implements_interface_diamond.<locals>.Child1Nr%rrr�Child1r��r8rr�c��eZdZy)�\Test_implementedByFallback.test_super_when_base_implements_interface_diamond.<locals>.Child2Nr%rrr�Child2r��r8rr�c��eZdZy)�]Test_implementedByFallback.test_super_when_base_implements_interface_diamond.<locals>.DerivedNr%rrrr�r��r'rr�r�)rrJr�r�r�r�r�r�r�r�r�s          �r�1test_super_when_base_implements_interface_diamondzLTest_implementedByFallback.test_super_when_base_implements_interface_diamond�s����,�;�	�I�	�	�u�	�
�U�	�	�	�
�	�	�T�	�	�T�	�
�X�	�	�f�f�	�
�	�	
����d�m�m�G�4�5��%�7H�I��G�W�%������d�m�m�C�0�1�E�7�;rc���ddlm}ddlm}Gd�d|�}Gd�d|�}Gd�d	�}Gd
�d|�}||�Gd�d
|��}||�Gd�d||��}|j	|j
||||tf�|j	t|j|��||g�t||�}	|j|	�}
|j	t|
�|g�|j|
j�y)NrrIr�c��eZdZy)�]Test_implementedByFallback.test_super_when_parent_implements_interface_diamond.<locals>.IBaseNr%rrrr�r��r8rr�c��eZdZy)�`Test_implementedByFallback.test_super_when_parent_implements_interface_diamond.<locals>.IDerivedNr%rrrr�r��r8rr�c��eZdZy)�\Test_implementedByFallback.test_super_when_parent_implements_interface_diamond.<locals>.BaseNr%rrrr�r��r8rr�c��eZdZy)�^Test_implementedByFallback.test_super_when_parent_implements_interface_diamond.<locals>.Child1Nr%rrrr�r��r8rr�c��eZdZy)�^Test_implementedByFallback.test_super_when_parent_implements_interface_diamond.<locals>.Child2Nr%rrrr�r��r'rr�c��eZdZy)�_Test_implementedByFallback.test_super_when_parent_implements_interface_diamond.<locals>.DerivedNr%rrrr�r��r'rr�)r�rJr)r�r*�__mro__rlrCrBr�rf�_dependents)rrJr�r�r�r�r�r�r�r��futr�s           �r�3test_super_when_parent_implements_interface_diamondzNTest_implementedByFallback.test_super_when_parent_implements_interface_diamond�s����,�;�	�I�	�	�u�	�	�	�	�T�	�
�U�	�	�T�	�
�	�
�X�	�	�f�f�	�
�	�	
������7�F�F�D�&�*Q�R�����d�m�m�G�4�5��%�7H�I��G�W�%���m�m�C� ������c��U�G�,����#�/�/�*rc�L��ddlm}ddlm}Gd�d|�}Gd�d|�}Gd�d	�}||�Gd
�d|��}|j	t|j
|��|g�t||�}|j	t|j
|��g�y)NrrIr�c��eZdZy)�YTest_implementedByFallback.test_super_when_base_doesnt_implement_interface.<locals>.IBaseNr%rrrr�r��r8rr�c��eZdZy)�\Test_implementedByFallback.test_super_when_base_doesnt_implement_interface.<locals>.IDerivedNr%rrrr�r��r8rr�c��eZdZy)�XTest_implementedByFallback.test_super_when_base_doesnt_implement_interface.<locals>.BaseNr%rrrr�r��r8rr�c��eZdZy)�[Test_implementedByFallback.test_super_when_base_doesnt_implement_interface.<locals>.DerivedNr%rrrr�r��r'rr�r�r�s	        �r�/test_super_when_base_doesnt_implement_interfacezJTest_implementedByFallback.test_super_when_base_doesnt_implement_interface�s����,�;�	�I�	�	�u�	�	�	�
�X�	�	�d�	�
�	�	
����d�m�m�G�4�5��z�B��G�W�%������d�m�m�C�0�1�2�6rc�6��ddlm}ddlm}Gd�d|�}Gd�d|�}||�Gd�d	��}|j	t|j
|��|g�t||�}|j	t|j
|��g�y)
NrrIr�c��eZdZy)�HTest_implementedByFallback.test_super_when_base_is_object.<locals>.IBaseNr%rrrr�r�
r8rr�c��eZdZy)�KTest_implementedByFallback.test_super_when_base_is_object.<locals>.IDerivedNr%rrrr�r�
r8rr�c��eZdZy)�JTest_implementedByFallback.test_super_when_base_is_object.<locals>.DerivedNr%rrrr�r�r'rr�r�)rrJr�r�r�r�r�r�s       �r�test_super_when_base_is_objectz9Test_implementedByFallback.test_super_when_base_is_objects����,�;�	�I�	�	�u�	�
�X�	�	�	�
�	�	
����d�m�m�G�4�5��z�B��G�W�%������d�m�m�C�0�1�2�6rc����ddlm}ddlm}Gd�d|�}Gd�d|�}Gd�d	|�}Gd
�d|�}Gd�d
|�}||�Gd�d��}||�Gd�d|��}	||�Gd�d|��}
|||�Gd�d|	|
��}|}t	||�}
t	|	|�}t	|
|�}|jt
|j|��|||||g�|jt
|j|
��|||g�|jt
|j|��||g�|jt
|j|��|g�y)Nrr�rIc��eZdZy)�RTest_implementedByFallback.test_super_multi_level_multi_inheritance.<locals>.IBaseNr%rrrr�r�r8rr�c��eZdZy)�PTest_implementedByFallback.test_super_multi_level_multi_inheritance.<locals>.IM1Nr%rrr�IM1r�r8rr�c��eZdZy)�PTest_implementedByFallback.test_super_multi_level_multi_inheritance.<locals>.IM2Nr%rrr�IM2r�"r8rr�c��eZdZy)�UTest_implementedByFallback.test_super_multi_level_multi_inheritance.<locals>.IDerivedNr%rrrr�r�%r8rr�c��eZdZy)�WTest_implementedByFallback.test_super_multi_level_multi_inheritance.<locals>.IUnrelatedNr%rrr�
IUnrelatedr�(r8rr�c��eZdZy)�QTest_implementedByFallback.test_super_multi_level_multi_inheritance.<locals>.BaseNr%rrrr�r�+r'rr�c��eZdZy)�OTest_implementedByFallback.test_super_multi_level_multi_inheritance.<locals>.M1Nr%rrr�M1r�/r'rr�c��eZdZy)�OTest_implementedByFallback.test_super_multi_level_multi_inheritance.<locals>.M2Nr%rrr�M2r�3r'rr�c��eZdZy)�TTest_implementedByFallback.test_super_multi_level_multi_inheritance.<locals>.DerivedNr%rrrr�r�7r'rr��r)r�r�rJr�r*rCrB�rr�rJr�r�r�r�r�r�r�r�r��d�sd�sm1�sm2r�s                �r�(test_super_multi_level_multi_inheritancezCTest_implementedByFallback.test_super_multi_level_multi_inheritances����;�,�	�I�	�	�)�	�	�)�	�	�u�	�	��	�
�U�	�	�	�
�	�
�S�	�	��	�
�	�
�S�	�	��	�
�	�
�X�z�	*�	�b�"�	�
+�	�
��
�7�G�
$���B�� ���B�� ������d�m�m�A�.�/�"�J��U�C�@�	B�����d�m�m�B�/�0��u�c�*�	,�����d�m�m�C�0�1��u��	'�����d�m�m�C�0�1���	"r)rrrrr�_getFallbackClassrBrLrYrcrgrkrtr|r�r�r�r�r�r�r�r�r�r�r�r�r�
__classcell__�r�s@rr>r>s���%�
(��3�7�9�
7�4�;�4�
4�
;�7�7�9�7�"?�4�<�,<�8+�@7�,7�$/"�/"rr>c��eZdZd�Zy)�Test_implementedByc��ddlm}|S)Nrr�r)rr�s  rrrz"Test_implementedBy._getTargetClassN���=��rN�rrrrrrrrr
r
Js��rr
c�0�eZdZdZd�Zdedzdfd�Zd�Zy)�_ImplementsTestMixinTc��t�r/r0)r�cls�ifaces   rrBz_ImplementsTestMixin._callFUTVs��!�!rNz.Foo�	not givenc�H�ddlm}ddlm}|d�}|j	||�}|j||�|j}	|�|j|	|�|j|	j|�|dk(r|n|}|j|	j|�|j|j|	�|jr^|j|j|�|j|j|�|j|j|j�||fS)Nrr�r�r�r)r)r�rKr�rBr�rGr*rr
�FUT_SETS_PROVIDED_BYr�r�r�)
rr&�	orig_spec�	spec_namer
r�r�r��returnedr{s
          r�_check_implementerz'_ImplementsTestMixin._check_implementerZs���	>�;��f�%���=�=��d�+���
�
�h��$��"�"��� ��M�M�$�	�*�������"�	$� �K�/�#�W���
�
�d�l�l�G�,��
�
�c�)�)�4�0��$�$��!�!�#�"4�"4�m�D��!�!�#�"2�"2�M�B����S�-�-�s�/A�/A�B��D�y�rc�:�Gd�d�}|j|�y)Nc��eZdZy)�,_ImplementsTestMixin.test_class.<locals>.FooNr%rrrr&rvr8rr&)rr�s  rr,z_ImplementsTestMixin.test_classus��	�	�����$r)rrrrrBrr,rrrrrSs'����"�
&*�%-��%6�#.��6%rrc�(�eZdZdZd�Zd�Zd�Zd�Zy)�Test_classImplementsOnlyFc�$�ddlm}|||�|S)Nr)�classImplementsOnly)r)r )rrrr s    rrBz!Test_classImplementsOnly._callFUT}s��C��C��'��
rc�T��ddlm}ddlm}|d�}|d�}||��|f�_G�fd�d�}|�_|j
||�|j|j�u�|j�j
d�|j�j|f�y)Nrr�r�r�r�c���eZdZW�Zy)�@Test_classImplementsOnly.test_w_existing_Implements.<locals>.FooNrorps�rr&r#�rqrr&)
r)r�rKr�rr
rBrUrGr*�rr�r�r�r�r&r�s      @rr�z3Test_classImplementsOnly.test_w_existing_Implements�s����:�;��f�%���f�%���$������
�	#�	#�����
�
�c�4� �����+�+�t�3�4�������t�,���������0rc���ddlm}ddlm}|d�}||��G�fd�d�}|j	|�dd��y)	Nrr�r�r�c���eZdZW�Zy)�0Test_classImplementsOnly.test_class.<locals>.FooNro)�old_specs�rr&r'�s���&�Orr&r	�r
)r)r�rKr�r)rr�r�r�r&r(s     @rr,z#Test_classImplementsOnly.test_class�s>���:�;��f�%���d�#��	'�	'�����X�s�D��Arc���|jtdtfi�d��\}}Gd�d|�}|j||�|j	|j|��y)Nr&r)c��eZdZy)�RTest_classImplementsOnly.test_redundant_with_super_still_implements.<locals>.ChildNr%rrr�Childr,�r8rr-)r�typerlrBrUr�)rr�r�r-s    r�*test_redundant_with_super_still_implementszCTest_classImplementsOnly.test_redundant_with_super_still_implements�s_���-�-����	�2�&��.�
���e�
	�D�	�	
�
�
�e�U�#�����+�+�E�2�3rN)rrrrrBr�r,r/rrrrrzs�� ���
1� B�
4rrc�6�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	y)	�Test_classImplementsc�F�ddlm}|||�}|j|�|S)Nr��classImplements)r)r4rf)rrrr4�results     rrBzTest_classImplements._callFUT�s$��?� ��e�,�����&�!��
rc���|j|�\}}Gd�d|�}|j||�}|jd|j�|j	d|j�|jd|j�|j
}|j
|jd�|j
|j|�|j|j|���y)Nc��eZdZy)�ATest_classImplements.__check_implementer_redundant.<locals>.ChildNr%rrrr-r8�r8rr-rGr�r�r)rrBr�r9rPrGr*rr
rU�
providedBy)rr�r�r-rr{s      r�__check_implementer_redundantz2Test_classImplements.__check_implementer_redundant�s����-�-�d�3���e�	�D�	��=�=���.���
�
�'��):�):�;����)�8�+<�+<�=��
�
�n�h�&7�&7�8��$�$���������+�������u�-�����(�(���1�2rc�:�Gd�d�}|j|�y)Nc��eZdZy)�UTest_classImplements.test_redundant_implementer_empty_class_declarations.<locals>.FooNr%rrrr&r=�r8rr&)�2_Test_classImplements__check_implementer_redundantr�s  r�3test_redundant_implementer_empty_class_declarationszHTest_classImplements.test_redundant_implementer_empty_class_declarations�s��	�	��*�*�3�/rc��ddlm}ddlm}ddlm}ddlm}Gd�d�}||jjd�5|j||�|jt||��|g�Gd	�d
|�}|j||�|jt||��|g�ddd�y#1swYyxYw)NrrIr�r�r�c��eZdZy)�FTest_classImplements.test_redundant_implementer_Interface.<locals>.FooNr%rrrr&rB�r8rr&Fc��eZdZy)�FTest_classImplements.test_redundant_implementer_Interface.<locals>.BazNr%rrr�BazrD����rrE)r�rJr�r�r�r�r�r�rBr*rC)rrJr�r�r�r&rEs       r�$test_redundant_implementer_Interfacez9Test_classImplements.test_redundant_implementer_Interface�s���,�0�%�:�	�	��r�u�u�'�'��
/�	D��M�M�#�y�)����T�-��"4�5�	�{�C�
�c�
�
�M�M�#�y�)����T�-��"4�5�	�{�C�	D�	D�	D�s
�A4B=�=Cc�
�||fSr/r�r�
applied_first�applied_seconds   r�_order_for_twoz#Test_classImplements._order_for_two�s
���~�.�.rc�p��ddlm}ddlm}|d�}|d�}||��|f�_G�fd�d�}|�_|j
||�|j|j��|j�j
|�|j�j|j||��y)Nrr�r�r�r�c���eZdZW�Zy)�<Test_classImplements.test_w_existing_Implements.<locals>.FooNrorps�rr&rO�rqrr&)r)r�rKr�rr
rBr�rGr*rLr$s      @rr�z/Test_classImplements.test_w_existing_Implements�s����:�;��f�%���f�%���$������
�	#�	#�����
�
�c�4� ��
�
�c�)�)�4�0�������s�+��������,�,�T�4�8�	:rc�b�	�
�ddlm}ddlm}|d�}|d�}|d|f�}|j	d|��
|f�
_G�
fd�d	�}G�
fd
�d�}|j	d|��	|f�	_G�	fd
�d||�}|�	_|j||�|j|j�	�|j�	j|�|j�	j
|j||��|j�	j|j||��
fz�y)Nrr�r��IRoot�ISecondRoot�IExtendsRoot�Rootc���eZdZW�Zy)�FTest_classImplements.test_w_existing_Implements_w_bases.<locals>.Root1Nro��	impl_roots�r�Root1rV�����'�OrrYc���eZdZW�Zy)�FTest_classImplements.test_w_existing_Implements_w_bases.<locals>.Root2NrorWs�r�Root2r\�rZrr]�ExtendsRoot1c���eZdZW�Zy)�LTest_classImplements.test_w_existing_Implements_w_bases.<locals>.ExtendsRootNro)�impl_extends_roots�r�ExtendsRootr`s���/�Orrb)
r)r�rKr�r!rr
rBr�rGr*rLr|)rr�r�rQrRrSrYr]rbrarXs         @@r�"test_w_existing_Implements_w_basesz7Test_classImplements.test_w_existing_Implements_w_bases�s#���:�;��w�'��$�]�3��%�n�u�h�?���$�$�V�U�3�	�#�X�	��	(�	(�	(�	(�'�,�,�^�\�J��&2�_��"�	0�%��	0�$/��!��
�
�k�;�/��
�
�k�1�1�3D�E����*�2�2�K�@����*�3�3��,�,�\�;�H�	J����*�4�4��,�,�\�;�G�9�,�V�	XrN)
rrrrBr>r?rGrLr�rcrrrr1r1�s'���3�&0�
D�&/�:�"Xrr1c��eZdZd�Zd�Zy)�Test_classImplementsFirstc�F�ddlm}|||�}|j|�|S)Nr)�classImplementsFirst)r)rgrf)rrrrgr5s     rrBz"Test_classImplementsFirst._callFUTs$��D�%�c�5�1�����&�!��
rc�
�||fSr/rrIs   rrLz(Test_classImplementsFirst._order_for_twos
���
�.�.rN)rrrrBrLrrrreres���/rrec��eZdZd�Zd�Zy)�Test__implements_advicec��ddlm}||i|��S)Nr)�_implements_advice)r)rl)rrwrxrls    rrBz Test__implements_advice._callFUT���B�!�4�.�2�.�.rc�4���ddlm�ddlm}ddlm}|d��G��fd�d�}|j|�|j
d|j�|j|j|�|jt|j��g�y)	Nrr3r�r�r�c���eZdZW�fW�fZy)�@Test__implements_advice.test_no_existing_implements.<locals>.FooN)rrr�__implements_advice_data__)r�r4s��rr&rp's���+/�'�?�)C�&rr&rq)r)r4r�rKr�rBrPr9r�rGr*rC)rr�r�r&r�r4s    @@r�test_no_existing_implementsz3Test__implements_advice.test_no_existing_implements"sv���?�:�;��f�%��	D�	D��
�
�c�����5�s�|�|�D����c�1�1�:�>�����c�1�1�2�T�F�;rN)rrrrBrrrrrrjrjs��/�
<rrjc�0�eZdZd�Zd�Zd�Zd�Zd�Zd�Zy)�Test_implementerc��ddlm}|S)Nrr�)r)r�)rr�s  rrrz Test_implementer._getTargetClass1rsrc�.�|j�|i|��Sr/rurvs   rryzTest_implementer._makeOne5rzrc�0�|j|�}||�Sr/�ry)rr�ifaces�	decorators    rrBzTest_implementer._callFUT8s��!�D�M�M�6�*�	���~�rc��ddlm}|d�}|j|�}|jt|t��yr)rKr�ryr�rrl)rr�r�rzs    r� test_nonclass_cannot_assign_attrz1Test_implementer.test_nonclass_cannot_assign_attr<s1��;��f�%���M�M�$�'�	����)�Y���9rc�X�ddlm}|d�}Gd�d�}|�}|j|�}||�}|j||u�|j}|j|jd�|j|j�|j|j|�y)Nrr�r�c��eZdZy)�;Test_implementer.test_nonclass_can_assign_attr.<locals>.FooNr%rrrr&rEr8rr&z(zope.interface.tests.test_declarations.?)
rKr�ryrUrGr*rrfr
r�)rr�r�r&r"rzrr{s        r�test_nonclass_can_assign_attrz.Test_implementer.test_nonclass_can_assign_attrBs���;��f�%��	�	��e���M�M�$�'�	��S�>������C��(��"�"��������(R�S����$�,�,�(��
�
�c�)�)�4�0rc�2�ddl}ddlm}|d�}t|j	��}td�D]}Gd�d�}|j
||�� |j�t|j	��}d}|j|||z�y)Nrr�r�ilc��eZdZy)�HTest_implementer.test_does_not_leak_on_unique_classes.<locals>.TestClassNr%rrr�	TestClassr�]rFrr�)	�gcrKr��len�get_objects�rangerB�collect�assertLessEqual)	rr�r�r��begin_count�_r��	end_count�fudge_factors	         r�$test_does_not_leak_on_unique_classesz5Test_implementer.test_does_not_leak_on_unique_classesPs���	�;��f�%���"�.�.�*�+���t��	+�A�
�
�
�M�M�)�T�*�		+�	�
�
������(�)�	������Y��l�(B�CrN)	rrrrrryrBr|r�r�rrrrtrt/s!���3��:�1�Drrtc�*�eZdZd�Zd�Zd�Zd�Zd�Zy)�Test_implementer_onlyc��ddlm}|S)Nr)�implementer_only)r)r�)rr�s  rrrz%Test_implementer_only._getTargetClassqs��@��rc�.�|j�|i|��Sr/rurvs   rryzTest_implementer_only._makeOneurzrc�4�|j|�}||�Sr/rx)rrrrzs    rrBzTest_implementer_only._callFUTxs���M�M�%�(�	���~�rc�v�ddlm}|d�}|j|�}d�}|jt||�y)Nrr�r�c��t��r/r0rrr�	_functionz6Test_implementer_only.test_function.<locals>._function����%�'�'r)rKr�ryr��
ValueError)rr�r�rzr�s     rr4z#Test_implementer_only.test_function|s4��;��f�%���M�M�$�'�	�	(����*�i��;rc��ddlm}|d�}|j|�}Gd�d�}|jt||j
�y)Nrr�r�c��eZdZd�Zy)�.Test_implementer_only.test_method.<locals>.Barc��t��r/r0r�s r�_methodz6Test_implementer_only.test_method.<locals>.Bar._method�r'rN)rrrr�rrr�Barr��s��
,rr�)rKr�ryr�r�r�)rr�r�rzr�s     r�test_methodz!Test_implementer_only.test_method�s?��;��f�%���M�M�$�'�	�	,�	,�	
���*�i����=rN)rrrrrryrBr4r�rrrr�r�os�� �3��<�>rr�c�0�eZdZd�Zd�Zd�Zd�Zd�Zd�Zy)�ProvidesClassTestsc��ddlm}|S�Nr��
ProvidesClass�r)r��rr�s  rrrz"ProvidesClassTests._getTargetClass�rrc�.�|j�|i|��Sr/rurvs   rryzProvidesClassTests._makeOne�rzrc��ddlm}|d�}Gd�d�}|j||�}|jt	|�|g�y)Nrr�r�c��eZdZy)�?ProvidesClassTests.test_simple_class_one_interface.<locals>.FooNr%rrrr&r��r8rr&r��rr�r�r&r{s     r�test_simple_class_one_interfacez2ProvidesClassTests.test_simple_class_one_interface�s?��;��f�%��	�	��}�}�S�$�'������d��d�V�,rc���ddlm}ddlm}|d�}Gd�d�}|j	||�}|j�\}}|j
||�|j|||f�y)Nr��Providesr�r�c��eZdZy)�/ProvidesClassTests.test___reduce__.<locals>.FooNr%rrrr&r��r8rr&)r)r�rKr�ryrr�r*)rr�r�r�r&r{�klassrws        rrz"ProvidesClassTests.test___reduce__�s^��8�;��f�%��	�	��}�}�S�$�'���o�o�'���t��
�
�e�X�&������T�{�+rc��ddlm}|d�}Gd�d�}|j||�}||_|j	|j|�y)Nrr�r�c��eZdZy)�2ProvidesClassTests.test___get___class.<locals>.FooNr%rrrr&r��r8rr&�rKr�ryr�r�r�s     r�test___get___classz%ProvidesClassTests.test___get___class�sE��;��f�%��	�	��}�}�S�$�'������
�
�c�&�&��-rc���ddlm}|d�}Gd�d��|j�|�}|�_�fd�}|j	t
|�y)Nrr�r�c��eZdZy)�5ProvidesClassTests.test___get___instance.<locals>.FooNr%rrrr&r��r8rr&c�*����}|jSr/)r�)r"r&s �r�_testz7ProvidesClassTests.test___get___instance.<locals>._test�s����%�C��#�#�#r)rKr�ryr�r��AttributeError)rr�r�r{r�r&s     @r�test___get___instancez(ProvidesClassTests.test___get___instance�sI���;��f�%��	�	��}�}�S�$�'�����	$�	
���.�%�0rN)	rrrrrryr�rr�r�rrrr�r��s ���3�-�	,�.�
1rr�c�$��eZdZ�fd�Zd�Z�xZS)�ProvidesClassStrictTestsc�@���t�|���G�fd�d��}|S)Nc���eZdZ�fd�Zy)�@ProvidesClassStrictTests._getTargetClass.<locals>.StrictProvidesc�,���j||d��S�NT)�	base_mrosrT��_do_calculate_ro)rr�r�s  �rr�zQProvidesClassStrictTests._getTargetClass.<locals>.StrictProvides._do_calculate_ro�����$�5�5�d�i�X\�5�]�]rN�rrrr�r�s�r�StrictProvidesr���	���
^rr��r�rr)rr�r�r�s  @�rrrz(ProvidesClassStrictTests._getTargetClass�s&�����/�1�
�	^�]�	^��rc	���ddlm}ddlm}ddlm}Gd�d|�}||�Gd�d��}|j	||�}|j|j|||�||t�|f�y)	Nrr�rIr�c��eZdZy)�MProvidesClassStrictTests.test_overlapping_interfaces_corrected.<locals>.IBaseNr%rrrr�r��r8rr�c��eZdZy)�LProvidesClassStrictTests.test_overlapping_interfaces_corrected.<locals>.BaseNr%rrrr�r��r'rr�)r�r�rJr�ryr*r]rl)rr�rJr�r�r�r{s       r�%test_overlapping_interfaces_correctedz>ProvidesClassStrictTests.test_overlapping_interfaces_corrected�s{��	1�,�.�	�I�	�
�U�	�	�	�
�	��}�}�T�5�)����������$����&�!��(
�	r�rrrrrr�rrs@rr�r��s
����rr�c�Z�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zy)�TestProvidesClassReprc��ddlm}|Sr�r�r�s  rrrz%TestProvidesClassRepr._getTargetClass�rrc�.�|j�|i|��Sr/rurvs   rryzTestProvidesClassRepr._makeOne�rzrc�0�ddlm}|d�}|jdk(sJ�|jtk(sJ�t	|�djt�k(sJ�|d�}|j
t|�||�}|jt	|�d�y)Nrr�r�z<InterfaceClass {}.IFoo>r�z3directlyProvides(TestProvidesClassRepr, IFoo, IBar))	rKr�rrr�formatryr.r*)rr�r�r��insts     r�test__repr__z"TestProvidesClassRepr.test__repr__�s���;��f�%���}�}��&�&�&����(�*�*�*��D�z�7�>�>�x�H�H�H�H��f�%���}�}�T�$�Z��t�4�������J�A�	
rc�^�ddlm}|j}|jt	|�d�y)Nr��dummyzIdirectlyProvides(sys.modules['zope.interface.tests.dummy'], IDummyModule))�zope.interface.testsr�r�r*r)rr��providess   r�'test__repr__module_provides_typical_usez=TestProvidesClassRepr.test__repr__module_provides_typical_use�s*��	/��%�%�������N�W�	
rc���ddl}ddlm}|j}t	|j
dz�D]8}|j
|j�5|j||�ddd��:y#1swY�ExYw)Nrr�r�)	r�r�r�r�r��HIGHEST_PROTOCOLr��
PicklingErrorr�)rr�r�r��protos     r�test__repr__module_after_picklez5TestProvidesClassRepr.test__repr__module_after_picklesn���.��%�%���6�2�2�Q�6�7�	.�E��"�"�6�#7�#7�8�
.����X�u�-�
.�
.�	.�
.�
.�s�
A+�+A4	c�Z�ddl}ddlm}ddlm}ddlm}ddlm}|d�}|d�}|j}|`|jt|d|�|||�|j}	|jt|	�d	�|||�|j}	|jt|	�d
�|jt}
t|
d�rJ�||
||�|jt |
d�|j#|
j|	�|jt|	�d�y)Nrr���directlyProvides��alsoProvidesr�r�r�r�zAdirectlyProvides(sys.modules['zope.interface.tests.dummy'], IFoo)zGdirectlyProvides(sys.modules['zope.interface.tests.dummy'], IFoo, IBar)zfdirectlyProvides(('zope.interface.tests.dummy', 'zope.interface.tests.test_declarations'), IFoo, IBar))�sysr�r�r)r�r�rKr�r��
addCleanup�setattrr*r�modulesr�hasattr�delattrr�)rr�r�r�r�r�r�r��
orig_providesr��	my_modules           r�#test__repr__directlyProvides_modulez9TestProvidesClassRepr.test__repr__directlyProvides_modules���.�@�<�;��f�%���f�%���*�*�
���������
�F����%��%�%�������N�O�	
�
	�U�D�!��%�%�������N�U�	
��K�K��)�	��9�n�5�5�5���D�$�/������N�;��
�
�i�,�,�h�7������N�
�	
rc���ddlm}ddlm}|d�}|j	||�}|xj
dz
c_|xj
dz
c_|j
t|�d�y)Nrr�)�
ModuleTyper�)zsome.module)zanother.modulez9directlyProvides(('some.module', 'another.module'), IFoo))rKr�r)r�ry�_v_module_namesr*r)rr�r�r�r�s     r�)test__repr__module_provides_cached_sharedz?TestProvidesClassRepr.test__repr__module_provides_cached_shared=s^��;�:��f�%���}�}�Z��.����� 0�0����� 3�3�������J�G�	
rc��ddlm}|dd��}|dd��}|d�}|jt|�|||�}|j	t|�d�y)	Nrr�r��mod1�r�mod2r�z>directlyProvides(TestProvidesClassRepr, IFoo, IBaz, mod2.IFoo)�rKr�ryr.r*r�rr�r��IFoo2r�r�s      r�test__repr__duplicate_namesz1TestProvidesClassRepr.test__repr__duplicate_namesJsW��;��f��8���v�&�9���f�%���}�}�T�$�Z��t�U�;�������J�L�	
rc���ddlm}ddlm}Gd�d|�}Gd�d�}|t|��}|j	|||�}|jt
|�d�y)	NrrIr�c��eZdZdZy)�KTestProvidesClassRepr.test__repr__implementedBy_in_interfaces.<locals>.IFoo�Does nothingN�rrr�__doc__rrrr�rY���rr�c��eZdZdZy)�JTestProvidesClassRepr.test__repr__implementedBy_in_interfaces.<locals>.BarrNr	rrrr�r
\rrr�zCdirectlyProvides(Bar, IFoo, classImplements(TestProvidesClassRepr)))r�rJr�r.ryr*r)rrJr�r�r�r�r�s       r�'test__repr__implementedBy_in_interfacesz=TestProvidesClassRepr.test__repr__implementedBy_in_interfacesVsX��,�0�	�9�	�	�	��T�$�Z�(���}�}�S�$��-�������J�Q�	
rc�n�|jt|��}|jt|�d�y)Nz'directlyProvides(TestProvidesClassRepr)�ryr.r*r�rr�s  r�test__repr__empty_interfacesz2TestProvidesClassRepr.test__repr__empty_interfacesgs,���}�}�T�$�Z�(�������J�5�	
rc���G�fd�d�}�j|��}�jt|�d�y)Nc�"��eZdZdZ�fd�Zd�Zy)�;TestProvidesClassRepr.test__repr__non_class.<locals>.Objectrc�&���jd�S)NzShould not call str)r)r�rs �r�<lambda>zDTestProvidesClassRepr.test__repr__non_class.<locals>.Object.<lambda>qs����	�	�*?� @�rc��y)Nz<Object>rr�s r�__repr__zDTestProvidesClassRepr.test__repr__non_class.<locals>.Object.__repr__ss��!rN)rrrr|�__str__rr�s�r�Objectros����I�@�G�
"rrzdirectlyProvides(<Object>))ryr*r)rrr�s`  r�test__repr__non_classz+TestProvidesClassRepr.test__repr__non_classns7���	"�	"��}�}�V�X�&�������J�(�	
rc��ddlm}ddlm}ddlm}|d�}||�Gd�d��}||��}|jt
|�d�y)	Nrr��r9r�r�c��eZdZy)�DTestProvidesClassRepr.test__repr__providedBy_from_class.<locals>.FooNr%rrrr&r �r'rr&�classImplements(Foo, IFoo))r)r�r9rKr�r*r)rr�r9r�r�r&r�s       r�!test__repr__providedBy_from_classz7TestProvidesClassRepr.test__repr__providedBy_from_class{sW��;�:�;��f�%��	�T�	�	�	�
�	��#�%� �������J�(�	
rc���ddlm}ddlm}ddlm}ddlm}|d�}|d�}||�Gd�d	��}|�}|||�||�}	|j
t|	�d
�y)Nrr�rr�r�r�r�c��eZdZy)�FTestProvidesClassRepr.test__repr__providedBy_alsoProvides.<locals>.FooNr%rrrr&r%�r'rr&z7directlyProvides(Foo, IBar, classImplements(Foo, IFoo)))r)r�r9r�rKr�r*r)
rr�r9r�r�r�r�r&r"r�s
          r�#test__repr__providedBy_alsoProvidesz9TestProvidesClassRepr.test__repr__providedBy_alsoProvides�sr��;�:�<�;��f�%���f�%��	�T�	�	�	�
�	��e���S�$���#��������J�E�	
rN)rrrrrryr�r�r�r�r�rrrrr"r&rrrr�r��sD���3�

�
�.�+
�Z
�

�
�"
�
�
� 
rr�c��eZdZd�Zd�Zd�Zy)�
Test_Providesc��ddlm}||i|��S)Nrr�)r)r�)rrwrxr�s    rrBzTest_Provides._callFUT�s��8���$��$�$rc��ddlm}ddlm}|d�}i}Gd�d�}t	||��5|j||�}ddd�|j
t�|g�|j|||f|u�y#1swY�>xYw)Nrr[r�r�c��eZdZy)�.Test_Provides.test_no_cached_spec.<locals>.FooNr%rrrr&r,�r8rr&��InstanceDeclarations)	r�r\rKr��_MonkeyrBr*rCrU)rr\r�r��cacher&r{s       r�test_no_cached_specz!Test_Provides.test_no_cached_spec�s���/�;��f�%����	�	�
�\��
>�	,��=�=��d�+�D�	,�����d��d�V�,�����s�D�k�*�d�2�3�	,�	,�s�A>�>Bc���ddlm}ddlm}|d�}t	�}Gd�d�}||f|i}t||��5|j
||�}ddd�|j|u�y#1swY�xYw)Nrr[r�r�c��eZdZy)�-Test_Provides.test_w_cached_spec.<locals>.FooNr%rrrr&r4�r8rr&r-)r�r\rKr�rlr/rBrU)rr\r�r��priorr&r0r{s        r�test_w_cached_specz Test_Provides.test_w_cached_spec�sp��/�;��f�%�����	�	��t��e�$��
�\��
>�	,��=�=��d�+�D�	,������
�&�	,�	,�s�A+�+A4N)rrrrBr1r6rrrr(r(�s��%�
4�
'rr(c�$�eZdZd�Zd�Zd�Zd�Zy)�Test_directlyProvidesc��ddlm}||i|��S)Nrr�)r)r�)rrwrxr�s    rrBzTest_directlyProvides._callFUT����@���,��,�,rc��ddlm}ddlm}|d�}Gd�d�}|�}|j	||�|j|j|�|jt|j�|g�y)Nrr�r�r�c��eZdZy)�7Test_directlyProvides.test_w_normal_object.<locals>.FooNr%rrrr&r=�r8rr&�	r)r�rKr�rBr�r�r*rC�rr�r�r�r&�objs      r�test_w_normal_objectz*Test_directlyProvides.test_w_normal_object��d��=�;��f�%��	�	��e���
�
�c�4� ����c�.�.�
�>�����c�.�.�/�$��8rc���ddlm}ddlm}|d�}Gd�d�}|j	||�|j|j|�|jt|j�|g�y)Nrr�r�r�c��eZdZy)�/Test_directlyProvides.test_w_class.<locals>.FooNr%rrrr&rE�r8rr&)	r)r�rKr�rBr�r�r*rC�rr�r�r�r&s     r�test_w_classz"Test_directlyProvides.test_w_class�s]��=�;��f�%��	�	��
�
�c�4� ����c�.�.�
�>�����c�.�.�/�$��8rc����ddlm}ddlm}|d�}i�G�fd�d�}|�}|j	||�|j�d|�|j
t�d�|g�y)Nrr�r�r�c���eZdZd�Z�fd�Zy)�:Test_directlyProvides.test_w_classless_object.<locals>.Fooc�$�|dk(ryt|���Nr�r0r%s  r�__getattribute__zKTest_directlyProvides.test_w_classless_object.<locals>.Foo.__getattribute__�s���;�&��)�$�/�/rc���|�|<yr/r)rr��value�the_dicts   �r�__setattr__zFTest_directlyProvides.test_w_classless_object.<locals>.Foo.__setattr__�s���!&���rN�rrrrMrQ�rPs�rr&rJ�s
���
0�

'rr&r�)r)r�rKr�rBr�r*rC)rr�r�r�r&r@rPs      @r�test_w_classless_objectz-Test_directlyProvides.test_w_classless_object�sj���=�;��f�%����	'�	'��e���
�
�c�4� ����h�~�6�
�F�����h�~�6�7�$��@rN)rrrrBrArGrTrrrr8r8�s��-�	9�9�Arr8c��eZdZd�Zd�Zd�Zy)�Test_alsoProvidesc��ddlm}||i|��S)Nrr�)r)r�)rrwrxr�s    rrBzTest_alsoProvides._callFUT�s��<��T�(�R�(�(rc��ddlm}ddlm}|d�}Gd�d�}|�}|j	||�|j|j|�|jt|j�|g�y)Nrr�r�r�c��eZdZy)�8Test_alsoProvides.test_wo_existing_provides.<locals>.FooNr%rrrr&rZ�r8rr&r>r?s      r�test_wo_existing_providesz+Test_alsoProvides.test_wo_existing_provides�rBrc�&�ddlm}ddlm}ddlm}|d�}|d�}Gd�d�}|�}|||�|j||�|j
|j|�|jt|j�||g�y)	Nrr�r�r�r�r�c��eZdZy)�7Test_alsoProvides.test_w_existing_provides.<locals>.FooNr%rrrr&r^r8rr&)
r)r�r�rKr�rBr�r�r*rC)rr�r�r�r�r�r&r@s        r�test_w_existing_providesz*Test_alsoProvides.test_w_existing_providess}��@�=�;��f�%���f�%��	�	��e����d�#��
�
�c�4� ����c�.�.�
�>�����c�.�.�/�$���>rN)rrrrBr[r_rrrrVrV�s��)�	9�?rrVc�*�eZdZd�Zd�Zd�Zd�Zd�Zy)�Test_noLongerProvidesc��ddlm}||i|��S)Nr)�noLongerProvides)r)rc)rrwrxrcs    rrBzTest_noLongerProvides._callFUTr:rc��ddlm}|d�}Gd�d�}|�}|j||�|jt	|j
�g�y)Nrr�r�c��eZdZy)�<Test_noLongerProvides.test_wo_existing_provides.<locals>.FooNr%rrrr&rfr8rr&)rKr�rBr*rCr�)rr�r�r&r@s     rr[z/Test_noLongerProvides.test_wo_existing_providessI��;��f�%��	�	��e���
�
�c�4� �����c�.�.�/��4rc���ddlm}ddlm}|d�}Gd�d�}|�}|||�|j	||�|jt
|j�g�y)Nrr�r�r�c��eZdZy)�?Test_noLongerProvides.test_w_existing_provides_hit.<locals>.FooNr%rrrr&ri"r8rr&�r)r�rKr�rBr*rCr�)rr�r�r�r&r@s      r�test_w_existing_provides_hitz2Test_noLongerProvides.test_w_existing_provides_hitsV��@�;��f�%��	�	��e����d�#��
�
�c�4� �����c�.�.�/��4rc���ddlm}ddlm}|d�}|d�}Gd�d�}|�}|||�|j	||�|jt
|j�|g�y)Nrr�r�r�r�c��eZdZy)�@Test_noLongerProvides.test_w_existing_provides_miss.<locals>.FooNr%rrrr&rn.r8rr&rj)rr�r�r�r�r&r@s       r�test_w_existing_provides_missz3Test_noLongerProvides.test_w_existing_provides_miss)sb��@�;��f�%���f�%��	�	��e����d�#��
�
�c�4� �����c�.�.�/�$��8rc��ddlm}ddlm}|d�}||�Gd�d��}|�}|j	t
|j||�y)Nrr�r�r�c��eZdZy)�DTest_noLongerProvides.test_w_iface_implemented_by_class.<locals>.FooNr%rrrr&rr9r'rr&)r)r�rKr�r�r�rB)rr�r�r�r&r@s      r�!test_w_iface_implemented_by_classz7Test_noLongerProvides.test_w_iface_implemented_by_class5sM��;�;��f�%��	�T�	�	�	�
�	��e�����*�d�m�m�S�$�?rN)rrrrBr[rkrorsrrrraras��-�5�	5�
9�@rrac�*�eZdZd�Zd�Zd�Zd�Zd�Zy)�ClassProvidesBaseFallbackTestsc��ddlm}|S�Nr)�ClassProvidesBaseFallback�r)rx�rrxs  rrrz.ClassProvidesBaseFallbackTests._getTargetClassB���I�(�(rc�F�Gd�d|j��}|||�S)Nc��eZdZd�Zy)�8ClassProvidesBaseFallbackTests._makeOne.<locals>.Derivedc� �||_||_yr/)�_cls�_implements)r�k�is   rr#zAClassProvidesBaseFallbackTests._makeOne.<locals>.Derived.__init__Ks����	�#$�� rN)rrrr#rrrr�r~Js��
%rr�ru)rr��
implementsr�s    rryz'ClassProvidesBaseFallbackTests._makeOneGs&��	%�d�*�*�,�	%��u�j�)�)rc��ddlm}|d�}Gd�d�}|j||�x}|_|j	|j|u�y)Nrr�r�c��eZdZy)�GClassProvidesBaseFallbackTests.test_w_same_class_via_class.<locals>.FooNr%rrrr&r�Sr8rr&)rKr�ryr�rU)rr�r�r&�cpbps     r�test_w_same_class_via_classz:ClassProvidesBaseFallbackTests.test_w_same_class_via_classPsH��;��f�%��	�	�"&�-�-��T�":�:��s������(�(�D�0�1rc��ddlm}|d�}Gd�d�}|�}|j||�|_|j	|j|�y)Nrr�r�c��eZdZy)�JClassProvidesBaseFallbackTests.test_w_same_class_via_instance.<locals>.FooNr%rrrr&r�[r8rr&r�)rr�r�r&r"s     r�test_w_same_class_via_instancez=ClassProvidesBaseFallbackTests.test_w_same_class_via_instanceXsG��;��f�%��	�	��e���=�=��d�3����
�
�c�&�&��-rc��ddlm}|d�}Gd�d�}Gd�d|�}|�}|j||�|_|j	t
t|d�|j	t
t|d�y)	Nrr�r�c��eZdZy)�BClassProvidesBaseFallbackTests.test_w_different_class.<locals>.FooNr%rrrr&r�dr8rr&c��eZdZy)�BClassProvidesBaseFallbackTests.test_w_different_class.<locals>.BarNr%rrrr�r�fr8rr�r�)rKr�ryr�r�r��getattr)rr�r�r&r��bars      r�test_w_different_classz5ClassProvidesBaseFallbackTests.test_w_different_classasg��;��f�%��	�	�	�#�	��e���=�=��d�3������.�'�3��G����.�'�3��GrN)rrrrrryr�r�r�rrrruru@s��)�
*�2�.�
Hrruc��eZdZd�Zd�Zy)�ClassProvidesBaseTestsc��ddlm}|S)Nr)�ClassProvidesBase)r)r�)rr�s  rrrz&ClassProvidesBaseTests._getTargetClassrs��A� � rc��ddlm}|Srwryrzs  rrz(ClassProvidesBaseTests._getFallbackClassvr{rN)rrrrrrrrrr�r�ns��!�)rr�c�$�eZdZd�Zd�Zd�Zd�Zy)�ClassProvidesTestsc��ddlm}|S�Nrr��r)r��rr�s  rrrz"ClassProvidesTests._getTargetClass~rrc�.�|j�|i|��Sr/rurvs   rryzClassProvidesTests._makeOne�rzrc�<�ddlm}ddlm}|d�}|d�}||�Gd�d��}|j	|t|�|�x}|_|j|j|u�|jt|�j�|g�y)Nrr�r�r�r�c��eZdZy)�7ClassProvidesTests.test_w_simple_metaclass.<locals>.FooNr%rrrr&r��r'rr&)
r)r�rKr�ryr.r�rUr*rC�rr�r�r�r�r&�cps       r�test_w_simple_metaclassz*ClassProvidesTests.test_w_simple_metaclass�s���;�;��f�%���f�%��	�T�	�	�	�
�	� $�
�
�c�4��9�d� C�C��S�
�����(�(�B�.�/�����c�e�0�0�1�D�6�:rc��ddlm}ddlm}|d�}|d�}||�Gd�d��}|j	|t|�|�x}|_|j|j�t|�|t|�|ff�y)Nrr�r�r�r�c��eZdZy)�/ClassProvidesTests.test___reduce__.<locals>.FooNr%rrrr&r��r'rr&)	r)r�rKr�ryr.r�r*rr�s       rrz"ClassProvidesTests.test___reduce__�s���;�;��f�%���f�%��	�T�	�	�	�
�	� $�
�
�c�4��9�d� C�C��S�
���������r�(�S�$�s�)�T�$:�;�	=rN)rrrrrryr�rrrrr�r�|s���3�
;�
=rr�c�$��eZdZ�fd�Zd�Z�xZS)�ClassProvidesStrictTestsc�@���t�|���G�fd�d��}|S)Nc���eZdZ�fd�Zy)�EClassProvidesStrictTests._getTargetClass.<locals>.StrictClassProvidesc�,���j||d��Sr�r�)rr�r�s  �rr�zVClassProvidesStrictTests._getTargetClass.<locals>.StrictClassProvides._do_calculate_ro�r�rNr�r�s�r�StrictClassProvidesr��r�rr�r�)rr�r�r�s  @�rrrz(ClassProvidesStrictTests._getTargetClass�s&�����/�1�
�	^�-�	^�#�"rc
�.�ddlm}ddlm}ddlm}Gd�d|�}||�Gd�dt��}|d	t
fi�}|j
|||�}|j|j|||�||t�|t
�|f�y)
Nrr�rIr�c��eZdZy)�MClassProvidesStrictTests.test_overlapping_interfaces_corrected.<locals>.IBaseNr%rrrr�r��r8rr�c��eZdZy)�QClassProvidesStrictTests.test_overlapping_interfaces_corrected.<locals>.metaclassNr%rrr�	metaclassr��r'rr�r)	r�r�rJr�r.rlryr*r])rr�rJr�r�r�rr{s        rr�z>ClassProvidesStrictTests.test_overlapping_interfaces_corrected�s���	1�,�.�	�I�	�
�U�	�	��	�
�	���
�I��
���}�}�S�)�U�3����������)�$���$���&�!��
(
�	rr�rs@rr�r��s
���#�rr�c�6�eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	y)	�TestClassProvidesReprc��ddlm}|Sr�r�r�s  rrrz%TestClassProvidesRepr._getTargetClass�rrc�.�|j�|i|��Sr/rurvs   rryzTestClassProvidesRepr._makeOne�rzrc�x�|jt|�t�}|jt|�d�y)Nz'directlyProvides(TestClassProvidesRepr)rrs  r�test__repr__emptyz'TestClassProvidesRepr.test__repr__empty�s.���}�}�T�$�Z��.�������J�5�	
rc��ddlm}Gd�d|�}|jt|�t|�}|j	t|�d�y)NrrIc��eZdZdZy)�=TestClassProvidesRepr.test__repr__providing_one.<locals>.IFoorNr	rrrr�r��rrr�z-directlyProvides(TestClassProvidesRepr, IFoo))r�rJryr.r*r)rrJr�r�s    r�test__repr__providing_onez/TestClassProvidesRepr.test__repr__providing_one�sA��,�	�9�	��}�}�T�$�Z��t�4�������J�;�	
rc���ddlm}|dd��}|dd��}|d�}|jt|�t|||�}|j	t|�d�y)	Nrr�r�r�r�rr�z>directlyProvides(TestClassProvidesRepr, IFoo, IBaz, mod2.IFoo)rrs      rrz1TestClassProvidesRepr.test__repr__duplicate_names�sY��;��f��8���v�&�9���f�%���}�}�T�$�Z��t�T�5�A�������J�L�	
rc��ddlm}ddlm}ddlm}|d�}||�Gd�d��}||�}|jt
|�d�y)	Nrr�r�r�r�c��eZdZy)�<TestClassProvidesRepr.test__repr__implementedBy.<locals>.FooNr%rrrr&r��r'rr&r!)r)r�r�rKr�r*r)rr�r�r�r�r&r�s       r�test__repr__implementedByz/TestClassProvidesRepr.test__repr__implementedBy�sU��;�=�;��f�%��	�T�	�	�	�
�	��S�!�������J�(�	
rc��ddlm}Gd�d�}||��}|jt|�dj	t
��|�}d|_||�}|jt|�d�y)Nrr�c��eZdZd�Zy)�RTestClassProvidesRepr.test__repr__implementedBy_generic_callable.<locals>.Callablec��|Sr/rr�s rrVz[TestClassProvidesRepr.test__repr__implementedBy_generic_callable.<locals>.Callable.__call__s���rN)rrrrVrrr�Callabler�s��
rr�zclassImplements({}.?)zclassImplements(Callable))r)r�r*rr�r)rr�r�r��cs     r�*test__repr__implementedBy_generic_callablez@TestClassProvidesRepr.test__repr__implementedBy_generic_callable�sr��=�	�	��X�Z�(�������J�#�*�*�8�4�	
�

�J����
��Q��������J�'�	
rN)
rrrrrryr�r�rr�r�rrrr�r��s%���3�
�	
�

�
� 
rr�c�*�eZdZd�Zd�Zd�Zd�Zd�Zy)�Test_directlyProvidedByc��ddlm}||i|��S)Nr)�directlyProvidedBy)r)r�)rrwrxr�s    rrBz Test_directlyProvidedBy._callFUTrmrc�z�Gd�d�}|�}|jt|j|��g�y)Nc��eZdZy)�NTest_directlyProvidedBy.test_wo_declarations_in_class_or_instance.<locals>.FooNr%rrrr&r�r8rr&r�rKs   r�)test_wo_declarations_in_class_or_instancezATest_directlyProvidedBy.test_wo_declarations_in_class_or_instances1��	�	��e������d�m�m�C�0�1�2�6rc��ddlm}ddlm}|d�}||�Gd�d��}|�}|j	t|j
|��g�y)Nrr�r�r�c��eZdZy)�RTest_directlyProvidedBy.test_w_declarations_in_class_but_not_instance.<locals>.FooNr%rrrr&r�%r'rr&)r)r�rKr�r*rCrB)rr�r�r�r&r"s      r�-test_w_declarations_in_class_but_not_instancezETest_directlyProvidedBy.test_w_declarations_in_class_but_not_instance!sS��;�;��f�%��	�T�	�	�	�
�	��e������d�m�m�C�0�1�2�6rc��ddlm}ddlm}|d�}Gd�d�}|�}|||�|j	t|j
|��|g�y)Nrr�r�r�c��eZdZy)�RTest_directlyProvidedBy.test_w_declarations_in_instance_but_not_class.<locals>.FooNr%rrrr&r�/r8rr&)r)r�rKr�r*rCrB)rr�r�r�r&r"s      r�-test_w_declarations_in_instance_but_not_classzETest_directlyProvidedBy.test_w_declarations_in_instance_but_not_class+sM��@�;��f�%��	�	��e����d�#�����d�m�m�C�0�1�D�6�:rc���ddlm}ddlm}ddlm}|d�}|d�}||�Gd�d��}|�}|||�|jt
|j|��|g�y)	Nrr�r�r�r�r�c��eZdZy)�NTest_directlyProvidedBy.test_w_declarations_in_instance_and_class.<locals>.FooNr%rrrr&r�;r'rr&)r)r�r�rKr�r*rCrB)rr�r�r�r�r�r&r"s        r�)test_w_declarations_in_instance_and_classzATest_directlyProvidedBy.test_w_declarations_in_instance_and_class5sl��@�;�;��f�%���f�%��	�T�	�	�	�
�	��e����d�#�����d�m�m�C�0�1�D�6�:rN)rrrrBr�r�r�r�rrrr�r�s��/�7�7�;�;rr�c��eZdZd�Zd�Zd�Zy)�
Test_providerc��ddlm}|S)Nr)�provider)r)r�)rr�s  rrrzTest_provider._getTargetClassEs
��8��rc�.�|j�|i|��Sr/rurvs   rryzTest_provider._makeOneIrzrc���ddlm}ddlm}|d�}|j	|�Gd�d��}|j|j|�|jt|j�|g�y)Nrr�r�r�c��eZdZy)�'Test_provider.test_w_class.<locals>.FooNr%rrrr&r�Pr'rr&)	r)r�rKr�ryr�r�r*rCrFs     rrGzTest_provider.test_w_classLse��=�;��f�%��	
���t�	�	�	�
�	����c�.�.�
�>�����c�.�.�/�$��8rN)rrrrrryrGrrrr�r�Cs���3�9rr�c�$�eZdZd�Zd�Zd�Zd�Zy)�Test_moduleProvidesc��ddlm}ddlm}|d�}d||d�}i}dj	dd	g�}t|||�|d
}|j
t|�y)Nr��moduleProvidesr�r��zope.interface.tests.foo�rr�r��
z
def foo():�    moduleProvides(IFoo)r")r)r�rKr��joinr
r�r)rr�r�r�rr�CODEr"s        r�test_called_from_functionz-Test_moduleProvides.test_called_from_functionZsg��>�;��f�%��7�#1�4�A�����y�y��&����	
�T�5�$���5�k�����)�S�)rc���ddlm}ddlm}|d�}d||d�}i}dj	dd	g�}|jt�5t|||�ddd�y#1swYyxYw)
Nrr�r�r�r�r�r�zclass Foo(object):r��r)r�rKr�r�r�rr
)rr�r�r�rrr�s       r�test_called_from_classz*Test_moduleProvides.test_called_from_classisq��>�;��f�%��7�#1�4�A�����y�y� �&�����
�
�y�
)�	$���u�d�#�	$�	$�	$�s�A�A%c��ddlm}ddlm}|d�}d||d�}dj	dg�}t||�|d	}|j
t|�|g�y)
Nrr�r�r�r�r�r��moduleProvides(IFoo)r�)r)r�rKr�r�r
r*rC)rr�r�r�rr�r{s       r�"test_called_once_from_module_scopez6Test_moduleProvides.test_called_once_from_module_scopewsd��>�;��f�%��7�#1�4�A���y�y�"����	
�T�5���^�$������d��d�V�,rc���ddlm}ddlm}|d�}d||d�}dj	ddg�}|jt�5t||�ddd�y#1swYyxYw)	Nrr�r�r�r�r�r�r�r�)rr�r�r�rr�s      r�#test_called_twice_from_module_scopez7Test_moduleProvides.test_called_twice_from_module_scope�sl��>�;��f�%��7�#1�4�A���y�y�"�"�����
�
�y�
)�	���u��	�	�	�s�
A�A"N)rrrr�r�r�r�rrrr�r�Ws��
*�$�-�rr�c�X�eZdZd�ZeZd�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zy
)�#Test_getObjectSpecificationFallbackc��ddlm}|S)Nr)�getObjectSpecificationFallback)r)r)rrs  rrz5Test_getObjectSpecificationFallback._getFallbackClass�s��N�-�-rc�.�|j�|i|��Sr/rurvs   rrBz,Test_getObjectSpecificationFallback._callFUT�rzrc���i�G�fd�d�}|�}|j|�}|jt|�g�y)Nc���eZdZ�fd�Zd�Zy)�TTest_getObjectSpecificationFallback.test_wo_existing_provides_classless.<locals>.Fooc�`��|dk(rt|��	�|S#t$rt|��wxYwrL)r��KeyError)rr�rPs  �rrMzeTest_getObjectSpecificationFallback.test_wo_existing_provides_classless.<locals>.Foo.__getattribute__�s?����;�&�(��.�.�/�#�D�>�)���/�(��.�.�/�s��-c��t��r/r0)rr�rOs   rrQz`Test_getObjectSpecificationFallback.test_wo_existing_provides_classless.<locals>.Foo.__setattr__�r'rNrRrSs�rr&r�s
���
/�
,rr&�rBr*rC)rr&r"r{rPs    @r�#test_wo_existing_provides_classlesszGTest_getObjectSpecificationFallback.test_wo_existing_provides_classless�s=�����
	,�
	,��e���}�}�S�!������d��R�(rc��ddlm}ddlm}|d�}d�}|||�|j	|�}|j||j�y)Nrr�r�r�c��t��r/r0rrrr"zOTest_getObjectSpecificationFallback.test_existing_provides_is_spec.<locals>.foo�r�r)r)r�rKr�rBr�r�)rr�r�r�r"r{s      r�test_existing_provides_is_speczBTest_getObjectSpecificationFallback.test_existing_provides_is_spec�sC��@�;��f�%��	(���d�#��}�}�S�!���
�
�d�C�,�,�-rc��d�}t�|_|j|�}|jt	|�g�y)Nc��t��r/r0rrrr"zSTest_getObjectSpecificationFallback.test_existing_provides_is_not_spec.<locals>.foo�r�r)rlr�rBr*rC)rr"r{s   r�"test_existing_provides_is_not_speczFTest_getObjectSpecificationFallback.test_existing_provides_is_not_spec�s3��	(�!�8����}�}�S�!������d��R�(rc��ddlm}ddlm}|d�}Gd�d�}|�}|||�|j	|�}|jt
|�|g�y)Nrr�r�r�c��eZdZy)�GTest_getObjectSpecificationFallback.test_existing_provides.<locals>.FooNr%rrrr&r�r8rr&)r)r�rKr�rBr*rC)rr�r�r�r&r"r{s       r�test_existing_providesz:Test_getObjectSpecificationFallback.test_existing_provides�sQ��@�;��f�%��	�	��e����d�#��}�}�S�!������d��d�V�,rc��ddlm}ddlm}|d�}||�Gd�d��}|�}|j	|�}|jt
|�|g�y)Nrr�r�r�c��eZdZy)�WTest_getObjectSpecificationFallback.test_wo_provides_on_class_w_implements.<locals>.FooNr%rrrr&r�r'rr&)r)r�rKr�rBr*rC�rr�r�r�r&r"r{s       r�&test_wo_provides_on_class_w_implementszJTest_getObjectSpecificationFallback.test_wo_provides_on_class_w_implements�sY��;�;��f�%��	�T�	�	�	�
�	��e���}�}�S�!������d��d�V�,rc�~�Gd�d�}|�}|j|�}|jt|�g�y)Nc��eZdZy)�XTest_getObjectSpecificationFallback.test_wo_provides_on_class_wo_implements.<locals>.FooNr%rrrr&r�r8rr&r	�rr&r"r{s    r�'test_wo_provides_on_class_wo_implementszKTest_getObjectSpecificationFallback.test_wo_provides_on_class_wo_implements��5��	�	��e���}�}�S�!������d��R�(rc�H�tj||jd��y)Nr���expected_missing�r�test_raisesrBr�s r�,test_catches_only_AttributeError_on_provideszPTest_getObjectSpecificationFallback.test_catches_only_AttributeError_on_provides�s���$�$�T�4�=�=�>�Zrc�J�tj||jdd��y)Nr�)r"r�r#r�s r�)test_catches_only_AttributeError_on_classzMTest_getObjectSpecificationFallback.test_catches_only_AttributeError_on_class�s���$�$�T�4�=�=�;�26�	8rc�D�Gd�d�}|j|��y)Nc��eZdZee�Zy)�yTest_getObjectSpecificationFallback.test_raises_AttributeError_when_provides_fails_type_check_AttributeError.<locals>.FooN)rrrrr�r�rrrr&r*�s��+�N�;�Lrr&)rBr�s  r�Htest_raises_AttributeError_when_provides_fails_type_check_AttributeErrorzlTest_getObjectSpecificationFallback.test_raises_AttributeError_when_provides_fails_type_check_AttributeError�s��	<�	<�	
�
�
�c�e�rc���Gd�d�}|jt�5}|j|��ddd�|jdjj
d�y#1swY�3xYw)Nc��eZdZee�Zy)�wTest_getObjectSpecificationFallback.test_raises_AttributeError_when_provides_fails_type_check_RuntimeError.<locals>.FooN)rrrr�RuntimeErrorr�rrrr&r.�s��+�L�9�Lrr&r�r)r�r/rBr*�	exceptionrw)rr&�excs   r�Ftest_raises_AttributeError_when_provides_fails_type_check_RuntimeErrorzjTest_getObjectSpecificationFallback.test_raises_AttributeError_when_provides_fails_type_check_RuntimeError�sb��	:�	:��
�
�|�
,�	!���M�M�#�%� �	!�	
����c�m�m�&8�&8��&;�<�	!�	!�s�A)�)A2N)rrrrrrrBr
r
rrrrr%r'r+r2rrrr�r��sF��.�
(�O�3�)�".�)�	-�	-�)�[�8��	=rr�c��eZdZd�Zy)�Test_getObjectSpecificationc��ddlm}|S)Nr)�getObjectSpecification)r)r6)rr6s  rrrz+Test_getObjectSpecification._getTargetClass�s��F�%�%rNr
rrrr4r4�s��&rr4c���eZdZd�ZeZd�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd	�Z�fd
�Z
�fd�Z�fd�Z�fd
�Z�fd�Zd�Zd�Z�xZS)�Test_providedByFallbackc��ddlm}|S)Nr)�providedByFallback)r)r:)rr:s  rrz)Test_providedByFallback._getFallbackClasss��B�!�!rc�.�|j�|i|��Sr/rurvs   rrBz Test_providedByFallback._callFUT
rzrc�~�Gd�d�}|�}|j|�}|jt|�g�y)Nc��eZdZy)�NTest_providedByFallback.test_wo_providedBy_on_class_wo_implements.<locals>.FooNr%rrrr&r>r8rr&r	rs    r�)test_wo_providedBy_on_class_wo_implementszATest_providedByFallback.test_wo_providedBy_on_class_wo_implementsrrc���ddlm}ddlm}|d�}Gd�d�}|�}|||�|_|j|�}|j
t|�|g�y)Nrr�r�r�c��eZdZy)�ATest_providedByFallback.test_w_providedBy_valid_spec.<locals>.FooNr%rrrr&rBr8rr&)r)r�rKr�r�rBr*rC)rr�r�r�r&r"r{s       r�test_w_providedBy_valid_specz4Test_providedByFallback.test_w_providedBy_valid_specsV��8�;��f�%��	�	��e��%�c�4�0����}�}�S�!������d��d�V�,rc��Gd�d�}|�}t�|_|j|�}|jt	|�g�y)Nc��eZdZy)�CTest_providedByFallback.test_w_providedBy_invalid_spec.<locals>.FooNr%rrrr&rF#r8rr&)rlr�rBr*rCrs    r�test_w_providedBy_invalid_specz6Test_providedByFallback.test_w_providedBy_invalid_spec"s?��	�	��e��#�X����}�}�S�!������d��R�(rc���ddlm}ddlm}|d�}||�Gd�d��}|�}t	�|_|j
|�}|jt|�|g�y)Nrr�r�r�c��eZdZy)�VTest_providedByFallback.test_w_providedBy_invalid_spec_class_w_implements.<locals>.FooNr%rrrr&rJ.r'rr&)	r)r�rKr�rlr�rBr*rCrs       r�1test_w_providedBy_invalid_spec_class_w_implementszITest_providedByFallback.test_w_providedBy_invalid_spec_class_w_implements*sc��;�;��f�%��	�T�	�	�	�
�	��e��#�X����}�}�S�!������d��d�V�,rc��Gd�d�}|�}t�|_t�x}|_|j|�}|j	||u�y)Nc��eZdZy)�cTest_providedByFallback.test_w_providedBy_invalid_spec_w_provides_no_provides_on_class.<locals>.FooNr%rrrr&rN7r8rr&�rlr�r�rBrU�rr&r"�expectedr{s     r�>test_w_providedBy_invalid_spec_w_provides_no_provides_on_classzVTest_providedByFallback.test_w_providedBy_invalid_spec_w_provides_no_provides_on_class6sK��	�	��e��#�X���&,�h�.��3�#��}�}�S�!�������(�)rc���Gd�d�}|�}t�|_t�x}|_t�|_|j|�}|j	||u�y)Nc��eZdZy)�eTest_providedByFallback.test_w_providedBy_invalid_spec_w_provides_diff_provides_on_class.<locals>.FooNr%rrrr&rU@r8rr&rOrPs     r�@test_w_providedBy_invalid_spec_w_provides_diff_provides_on_classzXTest_providedByFallback.test_w_providedBy_invalid_spec_w_provides_diff_provides_on_class?sU��	�	��e��#�X���&,�h�.��3�#�!�8����}�}�S�!�������(�)rc��ddlm}ddlm}|d�}||�Gd�d��}|�}t	�|_t	�x|_|_|j|�}|jt|�|g�y)Nrr�r�r�c��eZdZy)�eTest_providedByFallback.test_w_providedBy_invalid_spec_w_provides_same_provides_on_class.<locals>.FooNr%rrrr&rYMr'rr&)
r)r�rKr�rlr�r�rBr*rCrs       r�@test_w_providedBy_invalid_spec_w_provides_same_provides_on_classzXTest_providedByFallback.test_w_providedBy_invalid_spec_w_provides_same_provides_on_classIsu��;�;��f�%��	�T�	�	�	�
�	��e��#�X���.4�h�6���3�+��}�}�S�!������d��d�V�,rc���ddlm}ddlm}Gd�d|�}Gd�d|�}||�Gd�d	��}||�Gd
�d|��}|�}|j	t|j
|��||g�t||�}|j
|�}	|j|	j�|j	t|	�|g�y)NrrIr�c��eZdZy)�PTest_providedByFallback.test_super_when_base_implements_interface.<locals>.IBaseNr%rrrr�r]Zr8rr�c��eZdZy)�STest_providedByFallback.test_super_when_base_implements_interface.<locals>.IDerivedNr%rrrr�r_]r8rr�c��eZdZy)�OTest_providedByFallback.test_super_when_base_implements_interface.<locals>.BaseNr%rrrr�ra`r'rr�c��eZdZy)�RTest_providedByFallback.test_super_when_base_implements_interface.<locals>.DerivedNr%rrrr�rcdr'rr��
r�rJr)r�r*rCrBr�rfr�)rrJr�r�r�r�r��derivedr�r�r�s          �rr�zATest_providedByFallback.test_super_when_base_implements_interfaceVs����,�;�	�I�	�	�u�	�
�U�	�	�	�
�	�
�X�	�	�d�	�
�	��)������d�m�m�G�4�5��%�7H�I��G�W�%���m�m�C� �����#�/�/�*�����c��U�G�,rc�Z��ddlm}ddlm}Gd�d|�}Gd�d|�}Gd�d	�}||�Gd
�d|��}|�}|j	t|j
|��|g�t||�}|j	t|j
|��g�y)NrrIr�c��eZdZy)�VTest_providedByFallback.test_super_when_base_doesnt_implement_interface.<locals>.IBaseNr%rrrr�rhtr8rr�c��eZdZy)�YTest_providedByFallback.test_super_when_base_doesnt_implement_interface.<locals>.IDerivedNr%rrrr�rjwr8rr�c��eZdZy)�UTest_providedByFallback.test_super_when_base_doesnt_implement_interface.<locals>.BaseNr%rrrr�rlzr8rr�c��eZdZy)�XTest_providedByFallback.test_super_when_base_doesnt_implement_interface.<locals>.DerivedNr%rrrr�rn}r'rr�r�)
rrJr�r�r�r�r�rer�r�s
         �rr�zGTest_providedByFallback.test_super_when_base_doesnt_implement_interfaceps����,�;�	�I�	�	�u�	�	�	�
�X�	�	�d�	�
�	��)������d�m�m�G�4�5��z�B��G�W�%������d�m�m�C�0�1�2�6rc�~��ddlm}ddlm}Gd�d|�}Gd�d|�}||�Gd�d	��}|�}|j	t|j
|��|g�t||�}|j
|�}|j|j�|j	t|�g�y)
NrrIr�c��eZdZy)�ETest_providedByFallback.test_super_when_base_is_object.<locals>.IBaseNr%rrrr�rq�r8rr�c��eZdZy)�HTest_providedByFallback.test_super_when_base_is_object.<locals>.IDerivedNr%rrrr�rs�r8rr�c��eZdZy)�GTest_providedByFallback.test_super_when_base_is_object.<locals>.DerivedNr%rrrr�ru�r'rr�rd)
rrJr�r�r�r�rer�r�r�s
         �rr�z6Test_providedByFallback.test_super_when_base_is_object�s����,�;�	�I�	�	�u�	�
�X�	�	�	�
�	��)������d�m�m�G�4�5��z�B��G�W�%���m�m�C� �����#�/�/�*�����c��B�'rc���ddlm}ddlm}ddlm}Gd�d|�}Gd�d|�}||�Gd	�d
��}Gd�d|�}|�}|jt
|j|��|g�|||�|jt
|j|��||g�t||�}	|j|	�}
|j|
j�|jt
|
�|g�y)
NrrIr�r�c��eZdZy)�OTest_providedByFallback.test_super_when_object_directly_provides.<locals>.IBaseNr%rrrr�rx�r8rr�c��eZdZy)�RTest_providedByFallback.test_super_when_object_directly_provides.<locals>.IDerivedNr%rrrr�rz�r8rr�c��eZdZy)�NTest_providedByFallback.test_super_when_object_directly_provides.<locals>.BaseNr%rrrr�r|�r'rr�c��eZdZy)�QTest_providedByFallback.test_super_when_object_directly_provides.<locals>.DerivedNr%rrrr�r~�r8rr�)r�rJr)r�r�r*rCrBr�rfr�)rrJr�r�r�r�r�r�rer�r�r�s           �r�(test_super_when_object_directly_providesz@Test_providedByFallback.test_super_when_object_directly_provides�s����,�;�@�	�I�	�	�u�	�
�U�	�	�	�
�	�	�d�	��)������d�m�m�G�4�5��w�?���(�+�����d�m�m�G�4�5��%�7H�I��G�W�%���m�m�C� �����#�/�/�*�����c��U�G�,rc���ddlm}ddlm}Gd�d|�}Gd�d|�}Gd�d	|�}Gd
�d|�}Gd�d
|�}||�Gd�d��}||�Gd�d|��}	||�Gd�d|��}
|||�Gd�d|	|
��}|�}t	||�}
t	|	|�}t	|
|�}|jt
|j|��|||||g�|jt
|j|
��|||g�|jt
|j|��||g�|jt
|j|��|g�y)Nrr�rIc��eZdZy)�OTest_providedByFallback.test_super_multi_level_multi_inheritance.<locals>.IBaseNr%rrrr�r��r8rr�c��eZdZy)�MTest_providedByFallback.test_super_multi_level_multi_inheritance.<locals>.IM1Nr%rrrr�r��r8rr�c��eZdZy)�MTest_providedByFallback.test_super_multi_level_multi_inheritance.<locals>.IM2Nr%rrrr�r��r8rr�c��eZdZy)�RTest_providedByFallback.test_super_multi_level_multi_inheritance.<locals>.IDerivedNr%rrrr�r��r8rr�c��eZdZy)�TTest_providedByFallback.test_super_multi_level_multi_inheritance.<locals>.IUnrelatedNr%rrrr�r��r8rr�c��eZdZy)�NTest_providedByFallback.test_super_multi_level_multi_inheritance.<locals>.BaseNr%rrrr�r��r'rr�c��eZdZy)�LTest_providedByFallback.test_super_multi_level_multi_inheritance.<locals>.M1Nr%rrrr�r��r'rr�c��eZdZy)�LTest_providedByFallback.test_super_multi_level_multi_inheritance.<locals>.M2Nr%rrrr�r��r'rr�c��eZdZy)�QTest_providedByFallback.test_super_multi_level_multi_inheritance.<locals>.DerivedNr%rrrr�r��r'rr�r�rs                �rrz@Test_providedByFallback.test_super_multi_level_multi_inheritance�s����;�,�	�I�	�	�)�	�	�)�	�	�u�	�	��	�
�U�	�	�	�
�	�
�S�	�	��	�
�	�
�S�	�	��	�
�	�
�X�z�	*�	�b�"�	�
+�	�
�I��
�7�A�
���B��l���B��l������d�m�m�A�.�/�"�J��U�C�@�	B�����d�m�m�B�/�0��u�c�*�	,�����d�m�m�C�0�1��u��	'�����d�m�m�C�0�1���	"rc�R�tj||jdt��y)Nr�)r"r�)rr$rBrlr�s r�.test_catches_only_AttributeError_on_providedByzFTest_providedByFallback.test_catches_only_AttributeError_on_providedBy�s���$�$�T�4�=�=�6F�/5�	7rc�H�tj||jd��y)Nr�r!r#r�s rr'zATest_providedByFallback.test_catches_only_AttributeError_on_class�s��	�$�$��$�-�-�+�	?r)rrrrrrrBr?rCrGrKrRrVrZr�r�r�rrr�r'rrs@rr8r8s[���"�
(�O�3�)�	-�)�
-�*�*�-�-�47�.(�,-�:/"�b7�
?rr8c��eZdZd�Zy)�Test_providedByc��ddlm}|S)Nrr)r)r9)rr9s  rrrzTest_providedBy._getTargetClass�rrNr
rrrr�r��s��rr�c�@�eZdZd�ZeZd�Zd�Zd�Zd�Zd�Z	d�Z
d�Zy	)
�*ObjectSpecificationDescriptorFallbackTestsc��ddlm}|S)Nr)�%ObjectSpecificationDescriptorFallback)r)r�)rr�s  rrz<ObjectSpecificationDescriptorFallbackTests._getFallbackClass	s
��	9�4�4rc�.�|j�|i|��Sr/rurvs   rryz3ObjectSpecificationDescriptorFallbackTests._makeOne	rzrc���ddlm}ddlm}|d�}Gd�d�}|||�|_|j�|_|jt|j�|g�y)Nrr�r�r�c��eZdZy)�OObjectSpecificationDescriptorFallbackTests.test_accessed_via_class.<locals>.FooNr%rrrr&r�	r8rr&)	r)r�rKr�r�ryr�r*rC)rr�r�r�r&s     r�test_accessed_via_classzBObjectSpecificationDescriptorFallbackTests.test_accessed_via_class	sV��8�;��f�%��	�	�#�C��.���!�]�]�_�������c�0�0�1�D�6�:rc��ddlm}ddlm}ddlm}|d�}|d�}||�Gd�d��}|||�|_|j
�|_|�}|jt|j�|g�y)	Nrr�r�r�r�r�c��eZdZy)�ZObjectSpecificationDescriptorFallbackTests.test_accessed_via_inst_wo_provides.<locals>.FooNr%rrrr&r�	r'rr&)
r)r�r�rKr�r�ryr�r*rC)rr�r�r�r�r�r&r"s        r�"test_accessed_via_inst_wo_provideszMObjectSpecificationDescriptorFallbackTests.test_accessed_via_inst_wo_provides	s|��;�8�;��f�%���f�%��	�T�	�	�	�
�	�#�C��.���!�]�]�_����e������c�0�0�1�D�6�:rc�B�ddlm}ddlm}ddlm}ddlm}|d�}|d�}|d�}||�Gd	�d
��}|||�|_|j�|_|�}	||	|�|jt|	j�||g�y)Nrr�r�r�r�r�r�r�c��eZdZy)�YObjectSpecificationDescriptorFallbackTests.test_accessed_via_inst_w_provides.<locals>.FooNr%rrrr&r�.	r'rr&)r)r�r�r�rKr�r�ryr�r*rC)
rr�r�r�r�r�r�r�r&r"s
          r�!test_accessed_via_inst_w_provideszLObjectSpecificationDescriptorFallbackTests.test_accessed_via_inst_w_provides&	s���@�;�8�;��f�%���f�%���f�%��	�T�	�	�	�
�	�#�C��.���!�]�]�_����e����d�#�����c�0�0�1�D�$�<�@rc����Gd�dt��G��fd�d�}|�}�j��5t|d�ddd�y#1swYyxYw)Nc��eZdZy)�vObjectSpecificationDescriptorFallbackTests.test_arbitrary_exception_accessing_provides_not_caught.<locals>.MyExceptionNr%rrr�MyExceptionr�9	r8rr�c�D��eZdZW�j�Ze�fd��Zy)�nObjectSpecificationDescriptorFallbackTests.test_arbitrary_exception_accessing_provides_not_caught.<locals>.Fooc�����r/r)rr�s �rr�z{ObjectSpecificationDescriptorFallbackTests.test_arbitrary_exception_accessing_provides_not_caught.<locals>.Foo.__provides__?	s	���!�!rN�rrrryr�rWr�)r�rs��rr&r�<	s ���!�]�]�_�N�
�
"��
"rr&r�)�	Exceptionr�r�)rr&r"r�s`  @r�6test_arbitrary_exception_accessing_provides_not_caughtzaObjectSpecificationDescriptorFallbackTests.test_arbitrary_exception_accessing_provides_not_caught7	sP���	�)�	�	"�	"��e��
�
�
�{�
+�	+��C�)�*�	+�	+�	+�s�
A
�
Ac���Gd�dt�}G�fd�d�}|�}t|d�}�j|�y)Nc��eZdZy)�mObjectSpecificationDescriptorFallbackTests.test_AttributeError_accessing_provides_caught.<locals>.MyExceptionNr%rrrr�r�I	r8rr�c�@��eZdZW�j�Zed��Zy)�eObjectSpecificationDescriptorFallbackTests.test_AttributeError_accessing_provides_caught.<locals>.Fooc��t�r/)r�r�s rr�zrObjectSpecificationDescriptorFallbackTests.test_AttributeError_accessing_provides_caught.<locals>.Foo.__provides__O	s��$�$rNr�r�s�rr&r�L	s ���!�]�]�_�N�
�
%��
%rr&r�)r�r��assertIsNotNone)rr�r&r"�provideds`    r�-test_AttributeError_accessing_provides_caughtzXObjectSpecificationDescriptorFallbackTests.test_AttributeError_accessing_provides_caughtG	s=���	�)�	�	%�	%��e���3� 0�1�����X�&rc���ddlm}ddlm}Gd�d|�}||�Gd�d��}|j�|_t|�d�}|j
|�y)	NrrIr�c��eZdZy)�ZObjectSpecificationDescriptorFallbackTests.test_None_in__provides__overrides.<locals>.IFooNr%rrrr�r�[	r8rr�c��eZdZed��Zy)�YObjectSpecificationDescriptorFallbackTests.test_None_in__provides__overrides.<locals>.Fooc��yr/rr�s rr�zfObjectSpecificationDescriptorFallbackTests.test_None_in__provides__overrides.<locals>.Foo.__provides__a	s��rN)rrrrWr�rrrr&r�^	s���
��
rr&r�)r�rJr�ryr�r�rf)rrJr�r�r&r�s      r�!test_None_in__provides__overrideszLObjectSpecificationDescriptorFallbackTests.test_None_in__provides__overridesW	s_��,�.�	�9�	�
�T�	�	�	�
�	�"�]�]�_����3�5�"2�3�����(�#rN)rrrrrrryr�r�r�r�r�r�rrrr�r�	s2��5�(�O�3�;�;�A�"+� '� $rr�c��eZdZd�Zy)�"ObjectSpecificationDescriptorTestsc��ddlm}|S)Nr)�ObjectSpecificationDescriptor)r)r�)rr�s  rrrz2ObjectSpecificationDescriptorTests._getTargetClasso	s��M�,�,rNr
rrrr�r�j	s��
-rr�c��eZdZd�Zd�Zd�Zy)r/c��||_|D�cic]}|t||���c}|_|j�D]\}}t	|||��ycc}wr/)�moduler��
to_restore�itemsr�)rr�rx�keyrOs     rr#z_Monkey.__init__y	sR�����@B�C��3���� 4�4�C����(�(�*�	(�J�C���F�C��'�	(��Ds�Ac��|Sr/rr�s r�	__enter__z_Monkey.__enter__	s���rc�v�|jj�D]\}}t|j||��yr/)r�r�r�r�)r�exc_type�exc_val�exc_tbr�rOs      r�__exit__z_Monkey.__exit__�	s2���/�/�/�/�1�	-�J�C���D�K�K��e�,�	-rN�rrrr#r�r�rrrr/r/w	s��(��-rr/c��eZdZd�Zd�Zd�Zy)r`c���||_t||�|_|jj�|_|jj�|jj
|�yr/)r�r��target�copyr��clear�update)rr��attrnamerxs    rr#z_MonkeyDict.__init__�	sM������f�h�/����+�+�*�*�,��������������2�rc��|jSr/)r�r�s rr�z_MonkeyDict.__enter__�	s���{�{�rc��|jj�|jj|j�yr/)r�r�r�r�)rr�r�r�s    rr�z_MonkeyDict.__exit__�	s(�������������4�?�?�+rNr�rrrr`r`�	s����,rr`).r
�unittestr�rr�#zope.interface.tests.test_interfacerr�TestCaserr;rpr�r�r>r
rrr1rerjrtr�r�r�r�r(r8rVrarur�r�r�r�r�r�r�r�r4r8r�r�r�r/r`rrr�<module>r�s�����6�1�Q�
��(8��"�"�8�>7(�H�-�-�7(�tH9�,�H9�V@,�4�@,�Fp8�6��&�&�p8�f@"��!2�!2�@"�F
�3�.��%%�%%�N-4�3�X�5F�5F�-4�`cX�/��1B�1B�cX�L	/� 4�	/�<�h�/�/�<�&<D�+�<D�@>�4�>�D/1��*�*�/1�d�1��Dy
�H�-�-�y
�z'�H�%�%�'�>+A�H�-�-�+A�\?��)�)�?�@.@�H�-�-�.@�b+H�X�%6�%6�+H�\)�2�;�)�=��*�*�=�D&�1�&�RK
�H�-�-�K
�\+;�h�/�/�+;�\9�H�%�%�9�(9�(�+�+�9�xe=�(�*;�*;�e=�P&�"E�"7�&�p?�h�/�/�p?�h�-�+��g$��1B�1B�g$�R-�2��-�
-�
-� ,�,r

Zerion Mini Shell 1.0