<s> """<STR_LIT>""" <EOL> from twisted . plugin import getPlugins <EOL> from twisted . trial import unittest <EOL> from twisted . trial . itrial import IReporter <EOL> class TestPlugins ( unittest . TestCase ) : <EOL> """<STR_LIT>""" <EOL> def getPluginsByLongOption ( self , longOption ) : <EOL> """<STR_LIT>""" <EOL> plugins = [ <EOL> plugin for plugin in getPlugins ( IReporter ) <EOL> if plugin . longOpt == longOption ] <EOL> if len ( plugins ) > <NUM_LIT:1> : <EOL> raise ValueError ( <EOL> "<STR_LIT>" <EOL> % ( longOption , plugins ) ) <EOL> return plugins [ <NUM_LIT:0> ] <EOL> def test_subunitPlugin ( self ) : <EOL> """<STR_LIT>""" <EOL> subunitPlugin = self . getPluginsByLongOption ( '<STR_LIT>' ) <EOL> self . assertEquals ( '<STR_LIT>' , subunitPlugin . name ) <EOL> self . assertEquals ( '<STR_LIT>' , subunitPlugin . module ) <EOL> self . assertEquals ( '<STR_LIT>' , subunitPlugin . longOpt ) <EOL> self . assertIdentical ( None , subunitPlugin . shortOpt ) <EOL> self . assertEquals ( '<STR_LIT>' , subunitPlugin . klass ) </s>
