o
    Óó·i¼  ã                   @   s>   d Z ddlmZ ddlmZ ddlmZ G dd„ dejƒZdS )z-
Tests for L{twisted.plugins.twisted_trial}.
é    )Ú
getPlugins)Úunittest)Ú	IReporterc                   @   s"   e Zd ZdZdd„ Zddd„ZdS )	ÚPluginsTestsz-
    Tests for Trial's reporter plugins.
    c                    s:   ‡ fdd„t tƒD ƒ}t|ƒdkrtdˆ |f ƒ‚|d S )z±
        Return the Trial reporter plugin with the given long option.

        If more than one is found, raise ValueError. If none are found, raise
        IndexError.
        c                    s   g | ]	}|j ˆ kr|‘qS © )ÚlongOpt)Ú.0Zplugin©Ú
longOptionr   úeC:\Users\psant\Downloads\PAF backend\school\venv\Lib\site-packages\twisted/trial/test/test_plugins.pyÚ
<listcomp>   s
    
ÿÿz7PluginsTests.getPluginsByLongOption.<locals>.<listcomp>é   z2More than one plugin found with long option %r: %rr   N)r   r   ÚlenÚ
ValueError)Úselfr
   Zpluginsr   r	   r   ÚgetPluginsByLongOption   s   
ÿÿÿz#PluginsTests.getPluginsByLongOptionÚreturnNc                 C   sT   |   d¡}|  d|j¡ |  d|j¡ |  d|j¡ |  d|j¡ |  d|j¡ dS )zM
        One of the reporter plugins is the subunit reporter plugin.
        ZsubunitzSubunit Reporterztwisted.trial.reporterNZSubunitReporter)r   ÚassertEqualÚnameÚmoduler   ZassertIdenticalZshortOptÚklass)r   ZsubunitPluginr   r   r   Útest_subunitPlugin%   s   
zPluginsTests.test_subunitPlugin)r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r      s    r   N)	r   Ztwisted.pluginr   Ztwisted.trialr   Ztwisted.trial.itrialr   ZSynchronousTestCaser   r   r   r   r   Ú<module>   s
   