Bugfixes and a test.

This commit is contained in:
Jeremy Fincher 2004-08-30 21:46:04 +00:00
parent 74763d4dec
commit e138211f9b
2 changed files with 20 additions and 1 deletions

View File

@ -504,6 +504,9 @@ class Services(privmsgs.CapabilityCheckingPrivmsg):
if irc.nick in self.registryValue('nicks'):
self._doIdentify(irc, irc.nick)
irc.replySuccess()
else:
irc.error('I don\'t have a configured password for '
'my current nick.')
else:
irc.error('You must set supybot.plugins.Services.NickServ before '
'I\'m able to do identify.')

View File

@ -31,8 +31,24 @@
from testsupport import *
class ServicesTestCase(PluginTestCase, PluginDocumentation):
class ServicesTestCase(PluginTestCase):
plugins = ('Services',)
config = {
'plugins.Services.NickServ': 'NickServ',
'plugins.Services.ChanServ': 'ChanServ',
}
def testPasswordAndIdentify(self):
self.assertNotError('services password foo bar')
self.assertError('services identify') # Don't have a password.
self.assertNotError('services password %s baz' % self.nick)
m = self.assertNotError('services identify')
self.failUnless(m.args[0] == 'NickServ')
self.failUnless(m.args[1].lower() == 'identify baz')
self.assertNotError('services password %s biff' % self.nick)
m = self.assertNotError('services identify')
self.failUnless(m.args[0] == 'NickServ')
self.failUnless(m.args[1].lower() == 'identify biff')
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78: