o
    ¯b´  ã                   @   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„ 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)Ú.0Úplugin©Ú
longOptionr   úA/usr/lib/python3/dist-packages/twisted/trial/test/test_plugins.pyÚ
<listcomp>   s    z7PluginsTests.getPluginsByLongOption.<locals>.<listcomp>é   z2More than one plugin found with long option %r: %rr   )r   r   ÚlenÚ
ValueError)Úselfr   Úpluginsr   r
   r   ÚgetPluginsByLongOption   s   
ÿÿÿz#PluginsTests.getPluginsByLongOptionc                 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.
        ÚsubunitzSubunit Reporterztwisted.trial.reporterNÚSubunitReporter)r   ÚassertEqualÚnameÚmoduler   ÚassertIdenticalÚshortOptÚklass)r   ÚsubunitPluginr   r   r   Útest_subunitPlugin%   s   
zPluginsTests.test_subunitPluginN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r      s    r   N)	r!   Útwisted.pluginr   Útwisted.trialr   Útwisted.trial.itrialr   ÚSynchronousTestCaser   r   r   r   r   Ú<module>   s
   