mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-18 14:40:51 +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]
|
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):
|
class Formatter(logging.Formatter):
|
||||||
def formatTime(self, record, datefmt=None):
|
def formatTime(self, record, datefmt=None):
|
||||||
return timestamp(record.created)
|
return timestamp(record.created)
|
||||||
@ -220,6 +226,8 @@ def firewall(f, errorHandler=None):
|
|||||||
try:
|
try:
|
||||||
return f(self, *args, **kwargs)
|
return f(self, *args, **kwargs)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
|
if testing:
|
||||||
|
raise
|
||||||
logException(self)
|
logException(self)
|
||||||
if errorHandler is not None:
|
if errorHandler is not None:
|
||||||
try:
|
try:
|
||||||
|
@ -154,6 +154,7 @@ if __name__ == '__main__':
|
|||||||
if options.nonetwork:
|
if options.nonetwork:
|
||||||
testsupport.network = False
|
testsupport.network = False
|
||||||
|
|
||||||
|
log.testing = True
|
||||||
world.testing = True
|
world.testing = True
|
||||||
names = [os.path.splitext(os.path.basename(name))[0] for name in args]
|
names = [os.path.splitext(os.path.basename(name))[0] for name in args]
|
||||||
names.sort()
|
names.sort()
|
||||||
|
@ -83,14 +83,6 @@ class MiscTestCase(ChannelPluginTestCase):
|
|||||||
m = self.getMsg('help list') # Misc.list and User.list.
|
m = self.getMsg('help list') # Misc.list and User.list.
|
||||||
self.failIf(m.args[1].startswith('Error'))
|
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):
|
def testHelpIsCaseInsensitive(self):
|
||||||
self.assertHelp('help LIST')
|
self.assertHelp('help LIST')
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user