o
    ¯bÛ  ã                   @   sH   d Z ddlmZ ddlmZ ddlmZ ddlmZ G dd„ deƒZ	dS )	z0
Tests for L{twisted.trial._dist.distreporter}.
é    )ÚStringIO)ÚDistReporter)ÚTreeReporter)ÚTestCasec                   @   s0   e Zd ZdZdd„ Zdd„ Zdd„ Zdd	„ Zd
S )ÚDistReporterTestsz$
    Tests for L{DistReporter}.
    c                 C   s$   t ƒ | _tt| jƒƒ| _tƒ | _d S )N)r   Ústreamr   r   ÚdistReporterr   Útest©Úself© r   úL/usr/lib/python3/dist-packages/twisted/trial/_dist/test/test_distreporter.pyÚsetUp   s   zDistReporterTests.setUpc                 C   sd   | j  | j¡ |  | j ¡ d¡ | j  | j¡ |  | j ¡ d¡ | j  | j¡ |  | j ¡ d¡ dS )zY
        Success output only gets sent to the stream after the test has stopped.
        Ú N)	r   Ú	startTestr	   ÚassertEqualr   ÚgetvalueÚ
addSuccessÚstopTestÚassertNotEqualr
   r   r   r   Útest_startSuccessStop   s   z'DistReporterTests.test_startSuccessStopc                 C   sf   | j  | j¡ |  | j ¡ d¡ | j  | jd¡ |  | j ¡ d¡ | j  | j¡ |  | j ¡ d¡ dS )zW
        Error output only gets sent to the stream after the test has stopped.
        r   ÚerrorN)	r   r   r	   r   r   r   ÚaddErrorr   r   r
   r   r   r   Útest_startErrorStop$   s   z%DistReporterTests.test_startErrorStopc                 C   s‚   | j  | j¡ | j  | jd¡ | j  | jd¡ | j  | jd¡ | j  | jd¡ | j  | jdd¡ |  t	| j j
| j ¡  ƒd¡ dS )zh
        Calling methods of L{DistReporter} add calls to the running queue of
        the test.
        ÚfooÚbarÚeggÚspamÚerré   N)r   r   r	   Ú
addFailurer   ÚaddSkipÚaddUnexpectedSuccessÚaddExpectedFailurer   ÚlenÚrunningÚidr
   r   r   r   Útest_forwardedMethods/   s   "z'DistReporterTests.test_forwardedMethodsN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r'   r   r   r   r   r      s    r   N)
r+   Úior   Ú twisted.trial._dist.distreporterr   Útwisted.trial.reporterr   Útwisted.trial.unittestr   r   r   r   r   r   Ú<module>   s   