From a477f12f47f46312b0f148e8c0acd0d9e236eeca Mon Sep 17 00:00:00 2001 From: James Vega Date: Wed, 1 Jun 2005 21:06:04 +0000 Subject: [PATCH] plugins/Topic: Add a proper test for the previous Topic.set fix. --- plugins/Topic/test.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/Topic/test.py b/plugins/Topic/test.py index d3299a4a7..7506b1dbc 100644 --- a/plugins/Topic/test.py +++ b/plugins/Topic/test.py @@ -133,7 +133,14 @@ class TopicTestCase(ChannelPluginTestCase): self.assertNotRegexp('topic set -1 baz', 'bar') self.assertResponse('topic set foo bar baz', 'foo bar baz') # Catch a bug we had where setting topic 1 would reset the whole topic - self.assertNotResponse('topic set 1 bar', 'bar') + orig = conf.supybot.plugins.Topic.format() + sep = conf.supybot.plugins.Topic.separator() + try: + conf.supybot.plugins.Topic.format.setValue('$topic') + self.assertResponse('topic add baz', 'foo bar baz%sbaz' % sep) + self.assertResponse('topic set 1 bar', 'bar%sbaz' % sep) + finally: + conf.supybot.plugins.Topic.format.setValue(orig) def testUndo(self): try: