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

��e����dZddlZd�ZGd�dej�ZGd�dej�Zd�ZGd	�d
ej�ZGd�dej�Zy)
z& zope.interface.exceptions unit tests
�Nc�(�ddlm}Gd�d|�}|S)Nr)�	Interfacec��eZdZy)�_makeIface.<locals>.IDummyN)�__name__�
__module__�__qualname__���F/usr/lib/python3/dist-packages/zope/interface/tests/test_exceptions.py�IDummyrs��rr
)�zope.interfacer)rr
s  r�
_makeIfacers��(�
��
��Mrc�$�eZdZd�Zd�Zd�Zd�Zy)�DoesNotImplementTestsc��ddlm}|S)Nr)�DoesNotImplement)�zope.interface.exceptionsr)�selfrs  r�_getTargetClassz%DoesNotImplementTests._getTargetClasss��>��rc�D�t�}|j�|g|���S)N�rr�r�args�ifaces   r�_makeOnezDoesNotImplementTests._makeOnes$�����%�t�#�#�%�e�3�d�3�3rc�Z�|j�}|jt|�d�y)Nz�An object has failed to implement interface zope.interface.tests.test_exceptions.IDummy: Does not declaratively implement the interface.�r�assertEqual�str�r�dnis  r�test___str__z"DoesNotImplementTests.test___str__"s'���m�m�o�������H�
>�	
rc�\�|jd�}|jt|�d�y)N�	candidatez�The object 'candidate' has failed to implement interface zope.interface.tests.test_exceptions.IDummy: Does not declaratively implement the interface.rr!s  r�test___str__w_candidatez-DoesNotImplementTests.test___str__w_candidate+s*���m�m�K�(�������H�
>�	
rN�rrr	rrr#r&r
rrrrs�� �4�
�
rrc�$�eZdZd�Zd�Zd�Zd�Zy)�BrokenImplementationTestsc��ddlm}|S)Nr)�BrokenImplementation)rr+)rr+s  rrz)BrokenImplementationTests._getTargetClass7s��B�#�#rc�F�t�}|j�|dg|���S)N�missingrrs   rrz"BrokenImplementationTests._makeOne;s&�����%�t�#�#�%�e�Y�>��>�>rc�Z�|j�}|jt|�d�y)Nz�An object has failed to implement interface zope.interface.tests.test_exceptions.IDummy: The 'missing' attribute was not provided.rr!s  rr#z&BrokenImplementationTests.test___str__?s'���m�m�o�������H�
8�	9rc�\�|jd�}|jt|�d�y)Nr%z�The object 'candidate' has failed to implement interface zope.interface.tests.test_exceptions.IDummy: The 'missing' attribute was not provided.rr!s  rr&z1BrokenImplementationTests.test___str__w_candidateGs*���m�m�K�(�������H�
8�	9rNr'r
rrr)r)5s��$�?�9�9rr)c��y)z�
    This is a global function with a simple argument list.

    It exists to be able to report the same information when
    formatting signatures.
    Nr
r
rr�broken_functionr1Ps�rc�:�eZdZd�ZdZd�Zd�Zd�Zd�Zd�Z	d�Z
y	)
�BrokenMethodImplementationTestsc��ddlm}|S)Nr��BrokenMethodImplementation)rr6)rr6s  rrz/BrokenMethodImplementationTests._getTargetClass[s��H�)�)r�	I said soc�F�|j�d|jg|���S)N�aMethod)r�message)rrs  rrz(BrokenMethodImplementationTests._makeOneas#��%�t�#�#�%�i����E��E�Erc�Z�|j�}|jt|�d�y)NzoAn object has failed to implement interface <Unknown>: The contract of 'aMethod' is violated because I said so.rr!s  rr#z,BrokenMethodImplementationTests.test___str__ds(���m�m�o�������H�
G�	
rc�`�|jddd�}|jt|�d�y)N�
some_function�<IFoo>r%zyThe object 'candidate' has failed to implement interface <IFoo>: The contract of 'aMethod' is violated because I said so.rr!s  r�)test___str__w_candidate_no_implementationzIBrokenMethodImplementationTests.test___str__w_candidate_no_implementationls/���m�m�O�X�{�C�������H�
G�	
rc�v�d|_|jtdd�}|jt	|�d�y)Nzimplementation is wonkyr>r%z�The object 'candidate' has failed to implement interface <IFoo>: The contract of 'aMethod' is violated because 'broken_function()' is wonky.)r:rr1rr r!s  r�(test___str__w_candidate_w_implementationzHBrokenMethodImplementationTests.test___str__w_candidate_w_implementationts5��0����m�m�O�X�{�C�������H�
,�	
rc�n�d|_|jddd�}|jt|�d�y)Nzimplementation is not callable�*r>r%z�The object 'candidate' has failed to implement interface <IFoo>: The contract of 'aMethod' is violated because '42' is not callable.)r:rrr r!s  r�5test___str__w_candidate_w_implementation_not_callablezUBrokenMethodImplementationTests.test___str__w_candidate_w_implementation_not_callable~s5��7����m�m�B��+�6�������H�
$�	
rc�^�|jdd�}|jt|�d�y)Nr%zEBrokenMethodImplementation('aMethod', 'I said so', None, 'candidate'))rr�reprr!s  r�test___repr__w_candidatez8BrokenMethodImplementationTests.test___repr__w_candidate�s*���m�m�D�+�.�������I�S�	
rN)rrr	rr:rr#r?rArDrGr
rrr3r3Ys-��*��G�F�
�
�
�
�
rr3c�$�eZdZd�Zd�Zd�Zd�Zy)�MultipleInvalidTestsc��ddlm}|S)Nr)�MultipleInvalid)rrK)rrKs  rrz$MultipleInvalidTests._getTargetClass�s��=��rc�F�t�}|j�|d|�S)N�targetr)r�excsrs   rrzMultipleInvalidTests._makeOne�s#�����%�t�#�#�%�e�X�t�<�<rc��ddlm}|dd�td�g}|j|�}|j	t|�d�y)Nrr5r9r7zRegular exceptionz�The object 'target' has failed to implement interface zope.interface.tests.test_exceptions.IDummy:
    The contract of 'aMethod' is violated because I said so
    Regular exception)rr6�	Exceptionrrr �rr6rNr"s    r�test__str__z MultipleInvalidTests.test__str__�sI��H�&�y�+�>��)�*�
���m�m�D�!�������H�
$�	
rc��ddlm}|dd�tdd�g}|j|�}|j	t|�d�y)Nrr5r9r7�Regular�	exceptionz�MultipleInvalid(<InterfaceClass zope.interface.tests.test_exceptions.IDummy>, 'target', (BrokenMethodImplementation('aMethod', 'I said so'), Exception('Regular', 'exception'))))rr6rPrrrFrQs    r�test__repr__z!MultipleInvalidTests.test__repr__�sL��H�&�y�+�>�
�i��-�	
���m�m�D�!�������I�
3�	
rN)rrr	rrrRrVr
rrrIrI�s���=�

�
rrI)	�__doc__�unittestr�TestCaserr)r1r3rIr
rr�<module>rZs`�����
�H�-�-�
�:9�� 1� 1�9�6�4
�h�&7�&7�4
�n(
�8�,�,�(
r