From 5d15bbf1b26aa799c886a87ba2af7f96d7624636 Mon Sep 17 00:00:00 2001 From: Daniel Folkinshteyn Date: Thu, 29 Apr 2010 20:20:36 -0400 Subject: [PATCH] for Later plugin, add test for actual sending of notes to nicks upon their being seen. --- plugins/Later/test.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/plugins/Later/test.py b/plugins/Later/test.py index 5dd9d5259..49a5a672e 100644 --- a/plugins/Later/test.py +++ b/plugins/Later/test.py @@ -30,7 +30,7 @@ from supybot.test import * import time -class LaterTestCase(PluginTestCase): +class LaterTestCase(ChannelPluginTestCase): plugins = ('Later',) def testLaterWorksTwice(self): self.assertNotError('later tell foo bar') @@ -62,5 +62,17 @@ class LaterTestCase(PluginTestCase): self.assertNotRegexp('later notes', 'foo') self.assertRegexp('later notes', 'moo') + def testNoteSend(self): + self.assertNotError('later tell foo stuff') + self.assertNotError('later tell bar more stuff') + self.assertRegexp('later notes', 'bar.*foo') + testPrefix = 'foo!bar@baz' + self.irc.feedMsg(ircmsgs.privmsg(self.channel, 'something', + prefix=testPrefix)) + m = self.getMsg(' ') + self.failUnless(str(m).startswith('PRIVMSG foo :Sent just now: stuff')) + self.assertNotRegexp('later notes', 'foo') + self.assertRegexp('later notes', 'bar') + # vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79: