<s> """<STR_LIT>""" <EOL> from twisted . trial import unittest <EOL> from . . _levels import InvalidLogLevelError <EOL> from . . _levels import LogLevel <EOL> class LogLevelTests ( unittest . TestCase ) : <EOL> """<STR_LIT>""" <EOL> def test_levelWithName ( self ) : <EOL> """<STR_LIT>""" <EOL> for level in LogLevel . iterconstants ( ) : <EOL> self . assertIs ( LogLevel . levelWithName ( level . name ) , level ) <EOL> def test_levelWithInvalidName ( self ) : <EOL> """<STR_LIT>""" <EOL> bogus = "<STR_LIT>" <EOL> try : <EOL> LogLevel . levelWithName ( bogus ) <EOL> except InvalidLogLevelError as e : <EOL> self . assertIs ( e . level , bogus ) <EOL> else : <EOL> self . fail ( "<STR_LIT>" ) </s>
