mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-26 20:59:27 +01:00
Only firewall if we're not testing.
This commit is contained in:
parent
517a5909ea
commit
bd306febf0
@ -52,6 +52,12 @@ import supybot.ircutils as ircutils
|
||||
|
||||
deadlyExceptions = [KeyboardInterrupt, SystemExit]
|
||||
|
||||
###
|
||||
# This is for testing, of course. Mostly is just disables the firewall code
|
||||
# so exceptions can propagate.
|
||||
###
|
||||
testing = False
|
||||
|
||||
class Formatter(logging.Formatter):
|
||||
def formatTime(self, record, datefmt=None):
|
||||
return timestamp(record.created)
|
||||
@ -220,6 +226,8 @@ def firewall(f, errorHandler=None):
|
||||
try:
|
||||
return f(self, *args, **kwargs)
|
||||
except Exception, e:
|
||||
if testing:
|
||||
raise
|
||||
logException(self)
|
||||
if errorHandler is not None:
|
||||
try:
|
||||
|
@ -154,6 +154,7 @@ if __name__ == '__main__':
|
||||
if options.nonetwork:
|
||||
testsupport.network = False
|
||||
|
||||
log.testing = True
|
||||
world.testing = True
|
||||
names = [os.path.splitext(os.path.basename(name))[0] for name in args]
|
||||
names.sort()
|
||||
|
@ -83,14 +83,6 @@ class MiscTestCase(ChannelPluginTestCase):
|
||||
m = self.getMsg('help list') # Misc.list and User.list.
|
||||
self.failIf(m.args[1].startswith('Error'))
|
||||
|
||||
## def testHelpStripsPrefixChars(self):
|
||||
## try:
|
||||
## original = str(conf.supybot.prefixChars)
|
||||
## conf.supybot.prefixChars.set('@')
|
||||
## self.assertHelp('help @list')
|
||||
## finally:
|
||||
## conf.supybot.prefixChars.set(original)
|
||||
|
||||
def testHelpIsCaseInsensitive(self):
|
||||
self.assertHelp('help LIST')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user