U
    Ø’É]M
  ã                   @   sN   d Z ddlZdd„ ZG dd„ dejƒZG dd„ dejƒZG d	d
„ d
ejƒZdS )z& zope.interface.exceptions unit tests
é    Nc                  C   s    ddl m}  G dd„ d| ƒ}|S )Nr   )Ú	Interfacec                   @   s   e Zd ZdS )z_makeIface.<locals>.IDummyN)Ú__name__Ú
__module__Ú__qualname__© r   r   úF/usr/lib/python3/dist-packages/zope/interface/tests/test_exceptions.pyÚIDummy   s   r   )Zzope.interfacer   )r   r   r   r   r   Ú
_makeIface   s    r	   c                   @   s$   e Zd Zdd„ Zdd„ Zdd„ ZdS )ÚDoesNotImplementTestsc                 C   s   ddl m} |S )Nr   )ÚDoesNotImplement)Úzope.interface.exceptionsr   )Úselfr   r   r   r   Ú_getTargetClass   s    z%DoesNotImplementTests._getTargetClassc                 C   s   t ƒ }|  ¡ |ƒS ©N©r	   r   )r   Úifacer   r   r   Ú_makeOne   s    zDoesNotImplementTests._makeOnec                 C   s   |   ¡ }|  t|ƒd¡ d S )NzmAn object does not implement interface <InterfaceClass zope.interface.tests.test_exceptions.IDummy>

        ©r   ZassertEqualÚstr©r   Zdnir   r   r   Útest___str__"   s    
ÿz"DoesNotImplementTests.test___str__N©r   r   r   r   r   r   r   r   r   r   r
      s   r
   c                   @   s&   e Zd Zdd„ Zd	dd„Zdd„ ZdS )
ÚBrokenImplementationTestsc                 C   s   ddl m} |S )Nr   )ÚBrokenImplementation)r   r   )r   r   r   r   r   r   +   s    z)BrokenImplementationTests._getTargetClassÚmissingc                 C   s   t ƒ }|  ¡ ||ƒS r   r   )r   Únamer   r   r   r   r   /   s    z"BrokenImplementationTests._makeOnec                 C   s   |   ¡ }|  t|ƒd¡ d S )Nz¢An object has failed to implement interface <InterfaceClass zope.interface.tests.test_exceptions.IDummy>

        The missing attribute was not provided.
        r   r   r   r   r   r   3   s    
ÿz&BrokenImplementationTests.test___str__N)r   r   r   r   r   r   r   )   s   
r   c                   @   s&   e Zd Zdd„ Zd
dd„Zdd„ Zd	S )ÚBrokenMethodImplementationTestsc                 C   s   ddl m} |S )Nr   )ÚBrokenMethodImplementation)r   r   )r   r   r   r   r   r   =   s    z/BrokenMethodImplementationTests._getTargetClassÚaMethodú	I said soc                 C   s   |   ¡ ||ƒS r   )r   )r   ÚmethodZmessr   r   r   r   A   s    z(BrokenMethodImplementationTests._makeOnec                 C   s   |   ¡ }|  t|ƒd¡ d S )NzWThe implementation of aMethod violates its contract
        because I said so.
        r   r   r   r   r   r   D   s    
ÿz,BrokenMethodImplementationTests.test___str__N)r   r   r   r   r   r   r   r   ;   s   
r   )Ú__doc__Zunittestr	   ZTestCaser
   r   r   r   r   r   r   Ú<module>   s
   