mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-06 17:44:09 +01:00
Made to load Owner by default.
This commit is contained in:
parent
86b633cfe6
commit
232c634436
@ -111,7 +111,7 @@ class PluginTestCase(unittest.TestCase):
|
|||||||
for an example.
|
for an example.
|
||||||
"""
|
"""
|
||||||
timeout = 10
|
timeout = 10
|
||||||
plugins = ()
|
plugins = None
|
||||||
cleanConfDir = True
|
cleanConfDir = True
|
||||||
cleanDataDir = True
|
cleanDataDir = True
|
||||||
def setUp(self, nick='test'):
|
def setUp(self, nick='test'):
|
||||||
@ -125,18 +125,21 @@ class PluginTestCase(unittest.TestCase):
|
|||||||
debug.reset()
|
debug.reset()
|
||||||
ircdb.users.reload()
|
ircdb.users.reload()
|
||||||
ircdb.channels.reload()
|
ircdb.channels.reload()
|
||||||
if not self.plugins:
|
if self.plugins is None:
|
||||||
raise ValueError, 'PluginTestCase must have a "plugins" attribute.'
|
raise ValueError, 'PluginTestCase must have a "plugins" attribute.'
|
||||||
self.nick = nick
|
self.nick = nick
|
||||||
self.prefix = ircutils.joinHostmask(nick, 'user', 'host.domain.tld')
|
self.prefix = ircutils.joinHostmask(nick, 'user', 'host.domain.tld')
|
||||||
self.irc = irclib.Irc(nick)
|
self.irc = irclib.Irc(nick)
|
||||||
while self.irc.takeMsg():
|
while self.irc.takeMsg():
|
||||||
pass
|
pass
|
||||||
|
_ = Owner.loadPluginClass(self.irc, Owner)
|
||||||
if isinstance(self.plugins, str):
|
if isinstance(self.plugins, str):
|
||||||
|
if self.plugins != 'Owner':
|
||||||
module = Owner.loadPluginModule(self.plugins)
|
module = Owner.loadPluginModule(self.plugins)
|
||||||
cb = Owner.loadPluginClass(self.irc, module)
|
cb = Owner.loadPluginClass(self.irc, module)
|
||||||
else:
|
else:
|
||||||
for name in self.plugins:
|
for name in self.plugins:
|
||||||
|
if name != 'Owner':
|
||||||
module = Owner.loadPluginModule(name)
|
module = Owner.loadPluginModule(name)
|
||||||
cb = Owner.loadPluginClass(self.irc, module)
|
cb = Owner.loadPluginClass(self.irc, module)
|
||||||
|
|
||||||
@ -259,7 +262,6 @@ class PluginTestCase(unittest.TestCase):
|
|||||||
|
|
||||||
class ChannelPluginTestCase(PluginTestCase):
|
class ChannelPluginTestCase(PluginTestCase):
|
||||||
channel = '#test'
|
channel = '#test'
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
PluginTestCase.setUp(self)
|
PluginTestCase.setUp(self)
|
||||||
self.irc.feedMsg(ircmsgs.join(self.channel, prefix=self.prefix))
|
self.irc.feedMsg(ircmsgs.join(self.channel, prefix=self.prefix))
|
||||||
|
@ -32,8 +32,7 @@
|
|||||||
from test import *
|
from test import *
|
||||||
|
|
||||||
class MiscTestCase(ChannelPluginTestCase, PluginDocumentation):
|
class MiscTestCase(ChannelPluginTestCase, PluginDocumentation):
|
||||||
plugins = ('Misc', 'Owner',
|
plugins = ('Misc', 'Utilities', 'Gameknot', 'Ctcp')
|
||||||
'Utilities', 'Gameknot', 'Ctcp')
|
|
||||||
def testReplyWhenNotCommand(self):
|
def testReplyWhenNotCommand(self):
|
||||||
try:
|
try:
|
||||||
conf.replyWhenNotCommand = True
|
conf.replyWhenNotCommand = True
|
||||||
|
@ -38,7 +38,7 @@ except ImportError:
|
|||||||
|
|
||||||
if sqlite is not None:
|
if sqlite is not None:
|
||||||
class FactoidsTestCase(PluginTestCase, PluginDocumentation):
|
class FactoidsTestCase(PluginTestCase, PluginDocumentation):
|
||||||
plugins = ('Misc', 'MoobotFactoids', 'User')
|
plugins = ('Misc', 'MoobotFactoids', 'User', 'Utilities')
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
PluginTestCase.setUp(self)
|
PluginTestCase.setUp(self)
|
||||||
# Create a valid user to use
|
# Create a valid user to use
|
||||||
@ -185,6 +185,10 @@ if sqlite is not None:
|
|||||||
self.assertNotError('lock moo')
|
self.assertNotError('lock moo')
|
||||||
self.assertError('no moo is qux')
|
self.assertError('no moo is qux')
|
||||||
|
|
||||||
|
def testRegexpNotCalledIfAlreadyHandled(self):
|
||||||
|
self.assertResponse('echo foo is bar', 'foo is bar')
|
||||||
|
self.assertNoResponse(' ', 3)
|
||||||
|
|
||||||
class DunnoTestCase(PluginTestCase, PluginDocumentation):
|
class DunnoTestCase(PluginTestCase, PluginDocumentation):
|
||||||
plugins = ('Misc', 'MoobotFactoids', 'User')
|
plugins = ('Misc', 'MoobotFactoids', 'User')
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
@ -35,7 +35,7 @@ import conf
|
|||||||
import Owner
|
import Owner
|
||||||
|
|
||||||
class OwnerTestCase(PluginTestCase, PluginDocumentation):
|
class OwnerTestCase(PluginTestCase, PluginDocumentation):
|
||||||
plugins = ('Owner',)
|
plugins = ()
|
||||||
def testEval(self):
|
def testEval(self):
|
||||||
try:
|
try:
|
||||||
originalConfAllowEval = conf.allowEval
|
originalConfAllowEval = conf.allowEval
|
||||||
|
@ -34,7 +34,7 @@ from test import *
|
|||||||
import world
|
import world
|
||||||
|
|
||||||
class StatusTestCase(PluginTestCase, PluginDocumentation):
|
class StatusTestCase(PluginTestCase, PluginDocumentation):
|
||||||
plugins = ('Status', 'Owner')
|
plugins = ('Status',)
|
||||||
def testBestuptime(self):
|
def testBestuptime(self):
|
||||||
self.assertNotRegexp('bestuptime', '33 years')
|
self.assertNotRegexp('bestuptime', '33 years')
|
||||||
self.assertNotError('unload Status')
|
self.assertNotError('unload Status')
|
||||||
|
@ -163,7 +163,7 @@ class FunctionsTestCase(unittest.TestCase):
|
|||||||
|
|
||||||
|
|
||||||
class PrivmsgTestCase(ChannelPluginTestCase):
|
class PrivmsgTestCase(ChannelPluginTestCase):
|
||||||
plugins = ('Utilities', 'Owner', 'Misc')
|
plugins = ('Utilities', 'Misc')
|
||||||
conf.allowEval = True
|
conf.allowEval = True
|
||||||
timeout = 2
|
timeout = 2
|
||||||
def testEmptySquareBrackets(self):
|
def testEmptySquareBrackets(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user