<s> from supybot . test import * <EOL> from supybot import log <EOL> import supybot . utils . minisix as minisix <EOL> class FirewallTestCase ( SupyTestCase ) : <EOL> def setUp ( self ) : <EOL> log . testing = False <EOL> def tearDown ( self ) : <EOL> log . testing = True <EOL> exec ( """<STR_LIT>""" % <EOL> ( '<STR_LIT>' if minisix . PY3 else <EOL> '<STR_LIT>' ) ) <EOL> def testCFooDoesNotRaise ( self ) : <EOL> c = self . C ( ) <EOL> self . assertEqual ( c . foo ( ) , None ) <EOL> class D ( C ) : <EOL> def foo ( self ) : <EOL> raise self . MyException ( ) <EOL> def testDFooDoesNotRaise ( self ) : <EOL> d = self . D ( ) <EOL> self . assertEqual ( d . foo ( ) , None ) <EOL> class E ( C ) : <EOL> __firewalled__ = { '<STR_LIT:bar>' : None } <EOL> def foo ( self ) : <EOL> raise self . MyException ( ) <EOL> def bar ( self ) : <EOL> raise self . MyException ( ) <EOL> def testEFooDoesNotRaise ( self ) : <EOL> e = self . E ( ) <EOL> self . assertEqual ( e . foo ( ) , None ) <EOL> def testEBarDoesNotRaise ( self ) : <EOL> e = self . E ( ) <EOL> self . assertEqual ( e . bar ( ) , None ) <EOL> class F ( C ) : <EOL> __firewalled__ = { '<STR_LIT:bar>' : lambda self : <NUM_LIT:2> } <EOL> def bar ( self ) : <EOL> raise self . MyException ( ) <EOL> def testFBarReturns2 ( self ) : <EOL> f = self . F ( ) <EOL> self . assertEqual ( f . bar ( ) , <NUM_LIT:2> ) </s>
