mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-02 17:29:22 +01:00
Changed the Lookup test to run even when SQLite isn't installed.
This commit is contained in:
parent
baaa01755f
commit
e5d71ac10a
@ -42,27 +42,28 @@ class LookupTestCase(PluginTestCase, PluginDocumentation):
|
||||
'bar': 'baz',
|
||||
'your mom': 'my mom',
|
||||
}
|
||||
def setUp(self):
|
||||
PluginTestCase.setUp(self)
|
||||
fd = file(os.path.join(conf.dataDir, 'foo.supyfact'), 'w')
|
||||
for k, v in self.d.iteritems():
|
||||
fd.write('%s:%s\n' % (k, v))
|
||||
fd.close()
|
||||
if sqlite:
|
||||
def setUp(self):
|
||||
PluginTestCase.setUp(self)
|
||||
fd = file(os.path.join(conf.dataDir, 'foo.supyfact'), 'w')
|
||||
for k, v in self.d.iteritems():
|
||||
fd.write('%s:%s\n' % (k, v))
|
||||
fd.close()
|
||||
|
||||
def test(self):
|
||||
self.assertNotError('lookup add test foo.supyfact')
|
||||
self.assertRegexp('test', r"(foo|bar|your mom): (bar|baz|my mom)")
|
||||
self.assertResponse('test foo', 'bar')
|
||||
self.assertResponse('test bar', 'baz')
|
||||
self.assertResponse('test your mom', 'my mom')
|
||||
self.assertError('test something not in there')
|
||||
self.assertNotError('lookup remove test')
|
||||
try:
|
||||
original = conf.replyWhenNotCommand
|
||||
conf.replyWhenNotCommand = True
|
||||
self.assertError('test foo')
|
||||
finally:
|
||||
conf.replyWhenNotCommand = original
|
||||
def test(self):
|
||||
self.assertNotError('lookup add test foo.supyfact')
|
||||
self.assertRegexp('test', r"(foo|bar|your mom): (bar|baz|my mom)")
|
||||
self.assertResponse('test foo', 'bar')
|
||||
self.assertResponse('test bar', 'baz')
|
||||
self.assertResponse('test your mom', 'my mom')
|
||||
self.assertError('test something not in there')
|
||||
self.assertNotError('lookup remove test')
|
||||
try:
|
||||
original = conf.replyWhenNotCommand
|
||||
conf.replyWhenNotCommand = True
|
||||
self.assertError('test foo')
|
||||
finally:
|
||||
conf.replyWhenNotCommand = original
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user