From e138211f9b44ac713bf528100ad66c4b8084682c Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Mon, 30 Aug 2004 21:46:04 +0000 Subject: [PATCH] Bugfixes and a test. --- plugins/Services.py | 3 +++ test/test_Services.py | 18 +++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/plugins/Services.py b/plugins/Services.py index 638c46294..6cc4c18f4 100644 --- a/plugins/Services.py +++ b/plugins/Services.py @@ -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.') diff --git a/test/test_Services.py b/test/test_Services.py index 05b791122..b3ada3934 100644 --- a/test/test_Services.py +++ b/test/test_Services.py @@ -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: