a
    W×a‘
  ã                   @   sX   d Z ddlZe dd¡ ddlZddlZdZdZdZdZdd	d
„Z	G dd„ dej
ƒZdS )zSubunit test protocol.é    NÚiso8601Z	pyiso8601é   é   é   Ú c                 C   s   t t | ƒd fS ©N)Ú	Exception)Údescription© r
   ú8/usr/lib/python3/dist-packages/samba/subunit/__init__.pyÚRemoteError"   s    r   c                   @   sj   e Zd ZdZdd„ Zdd„ Zdd„ Zdd	„ Zd
d„ Zdd„ Z	dd„ Z
dd„ Zdd„ Zddd„Zdd„ ZdS )ÚRemotedTestCasea€  A class to represent test cases run in child processes.

    Instances of this class are used to provide the Python test API a TestCase
    that can be printed to the screen, introspected for metadata and so on.
    However, as they are a simply a memoisation of a test that was actually
    run in the past by a separate process, they cannot perform any interactive
    actions.
    c                 C   s(   z| j |j kW S  ty"   Y dS 0 d S )NF)Ú_RemotedTestCase__descriptionÚAttributeError)ÚselfÚotherr
   r
   r   Ú__eq__0   s    zRemotedTestCase.__eq__c                 C   s
   || _ dS )z7Create a psuedo test case with description description.N©r   )r   r	   r
   r
   r   Ú__init__6   s    zRemotedTestCase.__init__c                 C   s   t d| ƒ‚d S )Nz(%s on RemotedTestCases is not permitted.)ÚNotImplementedError)r   Zlabelr
   r
   r   Úerror:   s    ÿzRemotedTestCase.errorc                 C   s   |   d¡ d S )NÚsetUp©r   ©r   r
   r
   r   r   >   s    zRemotedTestCase.setUpc                 C   s   |   d¡ d S )NÚtearDownr   r   r
   r
   r   r   A   s    zRemotedTestCase.tearDownc                 C   s   | j S r   r   r   r
   r
   r   ÚshortDescriptionD   s    z RemotedTestCase.shortDescriptionc                 C   s   d| j f S )Nz%sr   r   r
   r
   r   ÚidG   s    zRemotedTestCase.idc                 C   s   d| j |  ¡ f S )Nz%s (%s))r   Ú	_strclassr   r
   r
   r   Ú__str__J   s    zRemotedTestCase.__str__c                 C   s   d|   ¡ | jf S )Nz<%s description='%s'>)r   r   r   r
   r
   r   Ú__repr__M   s    ÿzRemotedTestCase.__repr__Nc                 C   s8   |d u r|   ¡ }| | ¡ | | tdƒ¡ | | ¡ d S )NzCannot run RemotedTestCases.
)ZdefaultTestResultZ	startTestZaddErrorr   ZstopTest)r   Úresultr
   r
   r   ÚrunQ   s
    
zRemotedTestCase.runc                 C   s   | j }d|j|jf S )Nz%s.%s)Ú	__class__Ú
__module__Ú__name__)r   Úclsr
   r
   r   r   X   s    zRemotedTestCase._strclass)N)r$   r#   Ú__qualname__Ú__doc__r   r   r   r   r   r   r   r   r   r!   r   r
   r
   r
   r   r   &   s   	
r   )r   )r'   ZsambaZensure_third_party_moduler   ZunittestZPROGRESS_SETZPROGRESS_CURZPROGRESS_PUSHZPROGRESS_POPr   ZTestCaser   r
   r
   r
   r   Ú<module>   s   
