Ë
    š”e  ã                   óÄ   — d Z ddlZd„ Z G d„ dej                  «      Z G d„ dej                  «      Zd„ Z G d	„ d
ej                  «      Z G d„ dej                  «      Zy)z& zope.interface.exceptions unit tests
é    Nc                  ó(   — ddl m}   G d„ d| «      }|S )Nr   )Ú	Interfacec                   ó   — e Zd Zy)ú_makeIface.<locals>.IDummyN)Ú__name__Ú
__module__Ú__qualname__© ó    úF/usr/lib/python3/dist-packages/zope/interface/tests/test_exceptions.pyÚIDummyr      s   „ Ør   r   )Úzope.interfacer   )r   r   s     r   Ú
_makeIfacer      s   € Ý(ô�ô à€Mr   c                   ó$   — e Zd Zd„ Zd„ Zd„ Zd„ Zy)ÚDoesNotImplementTestsc                 ó   — ddl m} |S )Nr   )ÚDoesNotImplement)Úzope.interface.exceptionsr   )Úselfr   s     r   Ú_getTargetClassz%DoesNotImplementTests._getTargetClass   s   € Ý>ØÐr   c                 óD   — t        «       } | j                  «       |g|¢­Ž S )N©r   r   ©r   ÚargsÚifaces      r   Ú_makeOnezDoesNotImplementTests._makeOne   s$   € Ü“ˆØ%ˆt×#Ñ#Ó% eÐ3¨dÒ3Ð3r   c                 óZ   — | j                  «       }| j                  t        |«      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ð>õ	
r   c                 ó\   — | j                  d«      }| j                  t        |«      d«       y )NÚ	candidatez•The object 'candidate' has failed to implement interface zope.interface.tests.test_exceptions.IDummy: Does not declaratively implement the interface.r   r!   s     r   Útest___str__w_candidatez-DoesNotImplementTests.test___str__w_candidate+   s*   € Ø�m‰m˜KÓ(ˆØ×ÑÜ�‹Hð>õ	
r   N©r   r   r	   r   r   r#   r&   r
   r   r   r   r      s   „ ò ò4ò
ó
r   r   c                   ó$   — e Zd Zd„ Zd„ Zd„ Zd„ Zy)ÚBrokenImplementationTestsc                 ó   — ddl m} |S )Nr   )ÚBrokenImplementation)r   r+   )r   r+   s     r   r   z)BrokenImplementationTests._getTargetClass7   s   € ÝBØ#Ð#r   c                 óF   — t        «       } | j                  «       |dg|¢­Ž S )NÚmissingr   r   s      r   r   z"BrokenImplementationTests._makeOne;   s&   € Ü“ˆØ%ˆt×#Ñ#Ó% e¨YÐ>¸Ò>Ð>r   c                 óZ   — | j                  «       }| j                  t        |«      d«       y )Nz‚An object has failed to implement interface zope.interface.tests.test_exceptions.IDummy: The 'missing' attribute was not provided.r   r!   s     r   r#   z&BrokenImplementationTests.test___str__?   s'   € Ø�m‰m‹oˆØ×ÑÜ�‹Hð8õ	9r   c                 ó\   — | j                  d«      }| j                  t        |«      d«       y )Nr%   z�The object 'candidate' has failed to implement interface zope.interface.tests.test_exceptions.IDummy: The 'missing' attribute was not provided.r   r!   s     r   r&   z1BrokenImplementationTests.test___str__w_candidateG   s*   € Ø�m‰m˜KÓ(ˆØ×ÑÜ�‹Hð8õ	9r   Nr'   r
   r   r   r)   r)   5   s   „ ò$ò?ò9ó9r   r)   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
   r   r   Úbroken_functionr1   P   s   � r   c                   ó:   — e Zd Zd„ ZdZd„ Zd„ Zd„ Zd„ Zd„ Z	d„ Z
y	)
ÚBrokenMethodImplementationTestsc                 ó   — ddl m} |S )Nr   ©ÚBrokenMethodImplementation)r   r6   )r   r6   s     r   r   z/BrokenMethodImplementationTests._getTargetClass[   s   € ÝHØ)Ð)r   ú	I said soc                 óF   —  | j                  «       d| j                  g|¢­Ž S )NÚaMethod)r   Úmessage)r   r   s     r   r   z(BrokenMethodImplementationTests._makeOnea   s#   € Ø%ˆt×#Ñ#Ó% i°·±ÐEÀÒEÐEr   c                 óZ   — | j                  «       }| j                  t        |«      d«       y )NzoAn object has failed to implement interface <Unknown>: The contract of 'aMethod' is violated because I said so.r   r!   s     r   r#   z,BrokenMethodImplementationTests.test___str__d   s(   € Ø�m‰m‹oˆØ×ÑÜ�‹HðGõ	
r   c                 ó`   — | j                  ddd«      }| j                  t        |«      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.r   r!   s     r   Ú)test___str__w_candidate_no_implementationzIBrokenMethodImplementationTests.test___str__w_candidate_no_implementationl   s/   € Ø�m‰m˜O¨X°{ÓCˆØ×ÑÜ�‹HðGõ	
r   c                 óv   — d| _         | j                  t        dd«      }| j                  t	        |«      d«       y )Nzimplementation 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:   r   r1   r   r    r!   s     r   Ú(test___str__w_candidate_w_implementationzHBrokenMethodImplementationTests.test___str__w_candidate_w_implementationt   s5   € Ø0ˆŒØ�m‰mœO¨X°{ÓCˆØ×ÑÜ�‹Hð,õ	
r   c                 ón   — d| _         | j                  ddd«      }| j                  t        |«      d«       y )Nzimplementation 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:   r   r   r    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ð$õ	
r   c                 ó^   — | j                  d d«      }| j                  t        |«      d«       y )Nr%   zEBrokenMethodImplementation('aMethod', 'I said so', None, 'candidate'))r   r   Úreprr!   s     r   Útest___repr__w_candidatez8BrokenMethodImplementationTests.test___repr__w_candidateˆ   s*   € Ø�m‰m˜D +Ó.ˆØ×ÑÜ�‹IØSõ	
r   N)r   r   r	   r   r:   r   r#   r?   rA   rD   rG   r
   r   r   r3   r3   Y   s-   „ ò*ð €GòFò
ò
ò
ò
ó
r   r3   c                   ó$   — e Zd Zd„ Zd„ Zd„ Zd„ Zy)ÚMultipleInvalidTestsc                 ó   — ddl m} |S )Nr   )ÚMultipleInvalid)r   rK   )r   rK   s     r   r   z$MultipleInvalidTests._getTargetClass’   s   € Ý=ØÐr   c                 óF   — t        «       } | j                  «       |d|«      S )NÚtargetr   )r   Úexcsr   s      r   r   zMultipleInvalidTests._makeOne–   s#   € Ü“ˆØ%ˆt×#Ñ#Ó% e¨X°tÓ<Ð<r   c                 ó�   — ddl m}  |dd«      t        d«      g}| j                  |«      }| j	                  t        |«      d«       y )Nr   r5   r9   r7   zRegular 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)r   r6   Ú	Exceptionr   r   r    ©r   r6   rN   r"   s       r   Útest__str__z MultipleInvalidTests.test__str__š   sI   € ÝHá& y°+Ó>ÜÐ)Ó*ð
ˆð �m‰m˜DÓ!ˆØ×ÑÜ�‹Hð$õ	
r   c                 ó’   — ddl m}  |dd«      t        dd«      g}| j                  |«      }| j	                  t        |«      d«       y )Nr   r5   r9   r7   ÚRegularÚ	exceptionz°MultipleInvalid(<InterfaceClass zope.interface.tests.test_exceptions.IDummy>, 'target', (BrokenMethodImplementation('aMethod', 'I said so'), Exception('Regular', 'exception'))))r   r6   rP   r   r   rF   rQ   s       r   Útest__repr__z!MultipleInvalidTests.test__repr__©   sL   € ÝHá& y°+Ó>ô �i Ó-ð	
ˆð �m‰m˜DÓ!ˆØ×ÑÜ�‹Ið3õ	
r   N)r   r   r	   r   r   rR   rV   r
   r   r   rI   rI   �   s   „ òò=ò
ó
r   rI   )	Ú__doc__Úunittestr   ÚTestCaser   r)   r1   r3   rI   r
   r   r   ú<module>rZ      s`   ðñã òô
˜H×-Ñ-ô 
ô:9 × 1Ñ 1ô 9ò6ô4
 h×&7Ñ&7ô 4
ôn(
˜8×,Ñ,õ (
r   