mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-30 22:24:20 +01:00
Fixed escaping IOError from add command.
This commit is contained in:
parent
909597b7ac
commit
c17f85e51b
@ -130,8 +130,8 @@ class Lookup(callbacks.Privmsg):
|
|||||||
try:
|
try:
|
||||||
filename = os.path.join(conf.dataDir, filename)
|
filename = os.path.join(conf.dataDir, filename)
|
||||||
fd = file(filename)
|
fd = file(filename)
|
||||||
except OSError, e:
|
except EnvironmentError, e:
|
||||||
irc.error('Could open %s: %s' % (filename, e))
|
irc.error('Could not open %s: %s' % (filename, e))
|
||||||
return
|
return
|
||||||
cursor.execute("""CREATE TABLE %s (key TEXT, value TEXT)""" % name)
|
cursor.execute("""CREATE TABLE %s (key TEXT, value TEXT)""" % name)
|
||||||
sql = """INSERT INTO %s VALUES (%%s, %%s)""" % name
|
sql = """INSERT INTO %s VALUES (%%s, %%s)""" % name
|
||||||
|
@ -33,6 +33,11 @@ from test import *
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
try:
|
||||||
|
import sqlite
|
||||||
|
except ImportError:
|
||||||
|
sqlite = None
|
||||||
|
|
||||||
import conf
|
import conf
|
||||||
|
|
||||||
class LookupTestCase(PluginTestCase, PluginDocumentation):
|
class LookupTestCase(PluginTestCase, PluginDocumentation):
|
||||||
@ -65,6 +70,9 @@ class LookupTestCase(PluginTestCase, PluginDocumentation):
|
|||||||
finally:
|
finally:
|
||||||
conf.replyWhenNotCommand = original
|
conf.replyWhenNotCommand = original
|
||||||
|
|
||||||
|
def testNotEscapingIOError(self):
|
||||||
|
self.assertNotRegexp('lookup add foo asdlfkjsdalfkj', 'IOError')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78:
|
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78:
|
||||||
|
Loading…
Reference in New Issue
Block a user