K2LL33D SHELL

 Apache/2.4.7 (Ubuntu)
 Linux sman1baleendah 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64
 uid=33(www-data) gid=33(www-data) groups=33(www-data)
 safemode : OFF
 MySQL: ON | Perl: ON | cURL: OFF | WGet: ON
  >  / usr / lib / python2.7 / dist-packages / twisted / trial / test /
server ip : 104.21.89.46

your ip : 172.70.80.237

H O M E


Filename/usr/lib/python2.7/dist-packages/twisted/trial/test/test_plugins.py
Size1.42 kb
Permissionrw-r--r--
Ownerroot : root
Create time27-Apr-2025 09:56
Last modified23-Aug-2012 21:47
Last accessed07-Jul-2025 12:31
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
#
# Maintainer: Jonathan Lange

"""
Tests for L{twisted.plugins.twisted_trial}.
"""

from twisted.plugin import getPlugins
from twisted.trial import unittest
from twisted.trial.itrial import IReporter


class TestPlugins(unittest.SynchronousTestCase):
"""
Tests for Trial's reporter plugins.
"""

def getPluginsByLongOption(self, longOption):
"""
Return the Trial reporter plugin with the given long option.

If more than one is found, raise ValueError. If none are found, raise
IndexError.
"""
plugins = [
plugin for plugin in getPlugins(IReporter)
if plugin.longOpt == longOption]
if len(plugins) > 1:
raise ValueError(
"More than one plugin found with long option %r: %r"
% (longOption, plugins))
return plugins[0]


def test_subunitPlugin(self):
"""
One of the reporter plugins is the subunit reporter plugin.
"""
subunitPlugin = self.getPluginsByLongOption('subunit')
self.assertEqual('Subunit Reporter', subunitPlugin.name)
self.assertEqual('twisted.trial.reporter', subunitPlugin.module)
self.assertEqual('subunit', subunitPlugin.longOpt)
self.assertIdentical(None, subunitPlugin.shortOpt)
self.assertEqual('SubunitReporter', subunitPlugin.klass)