From 4de0a4948999b70cfba7fbfffb4c245f42d3d0ae Mon Sep 17 00:00:00 2001 From: James Vega Date: Fri, 5 May 2006 12:51:08 +0000 Subject: [PATCH] plugins/Misc/test.py: Correct a test and make a couple tests more robust. --- plugins/Misc/test.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/plugins/Misc/test.py b/plugins/Misc/test.py index aca6fc43d..96ae84bf8 100644 --- a/plugins/Misc/test.py +++ b/plugins/Misc/test.py @@ -27,6 +27,8 @@ # POSSIBILITY OF SUCH DAMAGE. ### +import re + from supybot.test import * class MiscTestCase(ChannelPluginTestCase): @@ -172,9 +174,10 @@ class MiscTestCase(ChannelPluginTestCase): orig = tsConfig() try: tsConfig.setValue(True) - self.feedMsg('foo bar baz') - self.assertRegexp('echo [last]', - '\[\d+:\d+:\d+\] foo bar baz') + self.getMsg('foo bar baz') + chars = conf.supybot.reply.whenAddressedBy.chars() + chars = re.escape(chars) + self.assertRegexp('echo [last]', r'. [%s]foo bar baz' % chars) finally: tsConfig.setValue(orig) @@ -184,8 +187,10 @@ class MiscTestCase(ChannelPluginTestCase): try: nickConfig.setValue(True) self.feedMsg('foo bar baz') + chars = conf.supybot.reply.whenAddressedBy.chars() + chars = re.escape(chars) self.assertRegexp('echo [last]', - '<%s> foo bar baz' % self.nick) + '<%s> [%s]foo bar baz' % (self.nick, chars)) finally: nickConfig.setValue(orig)