Fixed some bugs related to the new TestPlugin.

This commit is contained in:
Jeremy Fincher 2004-12-20 18:49:35 +00:00
parent c9360c3990
commit 84e2072903

View File

@ -120,6 +120,7 @@ class TestPlugin(callbacks.Privmsg):
except Exception, e: except Exception, e:
irc.reply(utils.exnToString(e)) irc.reply(utils.exnToString(e))
TestInstance = TestPlugin() TestInstance = TestPlugin()
conf.registerPlugin('TestPlugin', True, public=False)
class SupyTestCase(unittest.TestCase): class SupyTestCase(unittest.TestCase):
def setUp(self): def setUp(self):
@ -376,12 +377,14 @@ class PluginTestCase(SupyTestCase):
return self.assertActionRegexp(query, regexp, flags=re.I, return self.assertActionRegexp(query, regexp, flags=re.I,
usePrefixChar=False, **kwargs) usePrefixChar=False, **kwargs)
_noTestDoc = ('Admin', 'Channel', 'Config',
'Misc', 'Owner', 'User', 'TestPlugin')
def testDocumentation(self): def testDocumentation(self):
if self.__class__ in (PluginTestCase, ChannelPluginTestCase): if self.__class__ in (PluginTestCase, ChannelPluginTestCase):
return return
for cb in self.irc.callbacks: for cb in self.irc.callbacks:
name = cb.name() name = cb.name()
if (name in ('Admin', 'Channel', 'Misc', 'Owner', 'User') and \ if ((name in self._noTestDoc) and \
not name.lower() in self.__class__.__name__.lower()) or \ not name.lower() in self.__class__.__name__.lower()) or \
isinstance(cb, callbacks.PrivmsgRegexp): isinstance(cb, callbacks.PrivmsgRegexp):
continue continue