mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Updated to make sure the test doesn't run if sqlite isn't installed.
This commit is contained in:
parent
3af3b4c985
commit
93cc17ab43
@ -31,7 +31,13 @@
|
||||
|
||||
from test import *
|
||||
|
||||
class ChannelDBTestCase(ChannelPluginTestCase, PluginDocumentation):
|
||||
try:
|
||||
import sqlite
|
||||
except ImportError:
|
||||
sqlite = None
|
||||
|
||||
if sqlite is not None:
|
||||
class ChannelDBTestCase(ChannelPluginTestCase, PluginDocumentation):
|
||||
plugins = ('ChannelDB',)
|
||||
def test(self):
|
||||
self.assertNotError('channelstats')
|
||||
|
@ -31,7 +31,13 @@
|
||||
|
||||
from test import *
|
||||
|
||||
class FactoidsTestCase(ChannelPluginTestCase, PluginDocumentation):
|
||||
try:
|
||||
import sqlite
|
||||
except ImportError:
|
||||
sqlite = None
|
||||
|
||||
if sqlite is not None:
|
||||
class FactoidsTestCase(ChannelPluginTestCase, PluginDocumentation):
|
||||
plugins = ('Factoids',)
|
||||
def testRandomfactoid(self):
|
||||
self.assertError('randomfactoid')
|
||||
@ -43,7 +49,7 @@ class FactoidsTestCase(ChannelPluginTestCase, PluginDocumentation):
|
||||
self.assertNotError('factoidinfo jemfinch')
|
||||
self.assertRegexp('whatis jemfinch', 'my primary author')
|
||||
self.assertRegexp('whatis JEMFINCH', 'my primary author')
|
||||
self.assertNotError('learn jemfinch as a crappy assembly programmer')
|
||||
self.assertNotError('learn jemfinch as a bad assembly programmer')
|
||||
self.assertRegexp('whatis jemfinch', r'.*primary author.*assembly')
|
||||
self.assertError('forget jemfinch')
|
||||
self.assertError('forget jemfinch 3')
|
||||
@ -69,14 +75,16 @@ class FactoidsTestCase(ChannelPluginTestCase, PluginDocumentation):
|
||||
|
||||
def testSearchFactoids(self):
|
||||
self.assertNotError('learn jemfinch as my primary author')
|
||||
self.assertNotError('learn strike as another cool guy working on me')
|
||||
self.assertNotError('learn strike as a cool guy working on me')
|
||||
self.assertNotError('learn inkedmn as another of my developers')
|
||||
self.assertNotError('learn jamessan as a developer of much python')
|
||||
self.assertNotError('learn bwp as the author of my weather command')
|
||||
self.assertNotError('learn bwp as author of my weather command')
|
||||
self.assertRegexp('searchfactoids --regexp /.w./', 'bwp')
|
||||
self.assertRegexp('searchfactoids --regexp /^.+i/', 'jemfinch.*strike')
|
||||
self.assertRegexp('searchfactoids --regexp /^.+i/',
|
||||
'jemfinch.*strike')
|
||||
self.assertNotRegexp('searchfactoids --regexp /^.+i/', 'inkedmn')
|
||||
self.assertRegexp('searchfactoids --regexp /^j/', 'jemfinch.*jamessan')
|
||||
self.assertRegexp('searchfactoids --regexp /^j/',
|
||||
'jemfinch.*jamessan')
|
||||
self.assertRegexp('searchfactoids j*', 'jemfinch.*jamessan')
|
||||
self.assertRegexp('searchfactoids --exact ke',
|
||||
'inkedmn.*strike|strike.*inkedmn')
|
||||
|
@ -31,7 +31,13 @@
|
||||
|
||||
from test import *
|
||||
|
||||
class TestFunDB(PluginTestCase, PluginDocumentation):
|
||||
try:
|
||||
import sqlite
|
||||
except ImportError:
|
||||
sqlite = None
|
||||
|
||||
if sqlite is not None:
|
||||
class TestFunDB(PluginTestCase, PluginDocumentation):
|
||||
plugins = ('FunDB',)
|
||||
|
||||
def testDbAdd(self):
|
||||
|
@ -33,7 +33,14 @@ from test import *
|
||||
|
||||
import utils
|
||||
|
||||
class NewsTestCase(ChannelPluginTestCase):
|
||||
try:
|
||||
import sqlite
|
||||
except ImportError:
|
||||
sqlite = None
|
||||
|
||||
|
||||
if sqlite is not None:
|
||||
class NewsTestCase(ChannelPluginTestCase):
|
||||
plugins = ('News',)
|
||||
def testAddNews(self):
|
||||
self.assertNotError('addnews #somechannel 0 subject: foo')
|
||||
|
@ -34,7 +34,13 @@ from test import *
|
||||
import utils
|
||||
import ircdb
|
||||
|
||||
class NotesTestCase(PluginTestCase, PluginDocumentation):
|
||||
try:
|
||||
import sqlite
|
||||
except ImportError:
|
||||
sqlite = None
|
||||
|
||||
if sqlite is not None:
|
||||
class NotesTestCase(PluginTestCase, PluginDocumentation):
|
||||
plugins = ('Notes', 'MiscCommands', 'UserCommands')
|
||||
def testHelps(self):
|
||||
self.assertNotError('help sendnote')
|
||||
|
@ -31,7 +31,13 @@
|
||||
|
||||
from test import *
|
||||
|
||||
class QuotesTestCase(PluginTestCase, PluginDocumentation):
|
||||
try:
|
||||
import sqlite
|
||||
except ImportError:
|
||||
sqlite = None
|
||||
|
||||
if sqlite is not None:
|
||||
class QuotesTestCase(PluginTestCase, PluginDocumentation):
|
||||
plugins = ('Quotes',)
|
||||
def test(self):
|
||||
self.assertRegexp('numquotes #foo', '0')
|
||||
|
@ -66,8 +66,13 @@ http://gameknot.com/tsignup.pl
|
||||
http://lambda.weblogs.com/xml/rss.xml
|
||||
""".strip().splitlines()
|
||||
|
||||
try:
|
||||
import sqlite
|
||||
except ImportError:
|
||||
sqlite = None
|
||||
|
||||
class URLSnarferTestCase(ChannelPluginTestCase, PluginDocumentation):
|
||||
if sqlite is not None:
|
||||
class URLSnarferTestCase(ChannelPluginTestCase, PluginDocumentation):
|
||||
plugins = ('URLSnarfer',)
|
||||
def test(self):
|
||||
counter = 0
|
||||
|
Loading…
Reference in New Issue
Block a user