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 *
|
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',)
|
plugins = ('ChannelDB',)
|
||||||
def test(self):
|
def test(self):
|
||||||
self.assertNotError('channelstats')
|
self.assertNotError('channelstats')
|
||||||
|
@ -31,7 +31,13 @@
|
|||||||
|
|
||||||
from test import *
|
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',)
|
plugins = ('Factoids',)
|
||||||
def testRandomfactoid(self):
|
def testRandomfactoid(self):
|
||||||
self.assertError('randomfactoid')
|
self.assertError('randomfactoid')
|
||||||
@ -43,7 +49,7 @@ class FactoidsTestCase(ChannelPluginTestCase, PluginDocumentation):
|
|||||||
self.assertNotError('factoidinfo jemfinch')
|
self.assertNotError('factoidinfo jemfinch')
|
||||||
self.assertRegexp('whatis jemfinch', 'my primary author')
|
self.assertRegexp('whatis jemfinch', 'my primary author')
|
||||||
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.assertRegexp('whatis jemfinch', r'.*primary author.*assembly')
|
||||||
self.assertError('forget jemfinch')
|
self.assertError('forget jemfinch')
|
||||||
self.assertError('forget jemfinch 3')
|
self.assertError('forget jemfinch 3')
|
||||||
@ -69,14 +75,16 @@ class FactoidsTestCase(ChannelPluginTestCase, PluginDocumentation):
|
|||||||
|
|
||||||
def testSearchFactoids(self):
|
def testSearchFactoids(self):
|
||||||
self.assertNotError('learn jemfinch as my primary author')
|
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 inkedmn as another of my developers')
|
||||||
self.assertNotError('learn jamessan as a developer of much python')
|
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 /.w./', 'bwp')
|
||||||
self.assertRegexp('searchfactoids --regexp /^.+i/', 'jemfinch.*strike')
|
self.assertRegexp('searchfactoids --regexp /^.+i/',
|
||||||
|
'jemfinch.*strike')
|
||||||
self.assertNotRegexp('searchfactoids --regexp /^.+i/', 'inkedmn')
|
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 j*', 'jemfinch.*jamessan')
|
||||||
self.assertRegexp('searchfactoids --exact ke',
|
self.assertRegexp('searchfactoids --exact ke',
|
||||||
'inkedmn.*strike|strike.*inkedmn')
|
'inkedmn.*strike|strike.*inkedmn')
|
||||||
|
@ -31,7 +31,13 @@
|
|||||||
|
|
||||||
from test import *
|
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',)
|
plugins = ('FunDB',)
|
||||||
|
|
||||||
def testDbAdd(self):
|
def testDbAdd(self):
|
||||||
|
@ -33,7 +33,14 @@ from test import *
|
|||||||
|
|
||||||
import utils
|
import utils
|
||||||
|
|
||||||
class NewsTestCase(ChannelPluginTestCase):
|
try:
|
||||||
|
import sqlite
|
||||||
|
except ImportError:
|
||||||
|
sqlite = None
|
||||||
|
|
||||||
|
|
||||||
|
if sqlite is not None:
|
||||||
|
class NewsTestCase(ChannelPluginTestCase):
|
||||||
plugins = ('News',)
|
plugins = ('News',)
|
||||||
def testAddNews(self):
|
def testAddNews(self):
|
||||||
self.assertNotError('addnews #somechannel 0 subject: foo')
|
self.assertNotError('addnews #somechannel 0 subject: foo')
|
||||||
|
@ -34,7 +34,13 @@ from test import *
|
|||||||
import utils
|
import utils
|
||||||
import ircdb
|
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')
|
plugins = ('Notes', 'MiscCommands', 'UserCommands')
|
||||||
def testHelps(self):
|
def testHelps(self):
|
||||||
self.assertNotError('help sendnote')
|
self.assertNotError('help sendnote')
|
||||||
|
@ -31,7 +31,13 @@
|
|||||||
|
|
||||||
from test import *
|
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',)
|
plugins = ('Quotes',)
|
||||||
def test(self):
|
def test(self):
|
||||||
self.assertRegexp('numquotes #foo', '0')
|
self.assertRegexp('numquotes #foo', '0')
|
||||||
|
@ -66,8 +66,13 @@ http://gameknot.com/tsignup.pl
|
|||||||
http://lambda.weblogs.com/xml/rss.xml
|
http://lambda.weblogs.com/xml/rss.xml
|
||||||
""".strip().splitlines()
|
""".strip().splitlines()
|
||||||
|
|
||||||
|
try:
|
||||||
|
import sqlite
|
||||||
|
except ImportError:
|
||||||
|
sqlite = None
|
||||||
|
|
||||||
class URLSnarferTestCase(ChannelPluginTestCase, PluginDocumentation):
|
if sqlite is not None:
|
||||||
|
class URLSnarferTestCase(ChannelPluginTestCase, PluginDocumentation):
|
||||||
plugins = ('URLSnarfer',)
|
plugins = ('URLSnarfer',)
|
||||||
def test(self):
|
def test(self):
|
||||||
counter = 0
|
counter = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user