From 80777b942f3dded9605d0cee350516b92c4269c0 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Fri, 24 Oct 2003 11:44:44 +0000 Subject: [PATCH] Added assertHelp to remedy the fact that help strings now count as errors. --- test/test.py | 6 ++++++ test/test_Misc.py | 6 +++--- test/test_callbacks.py | 4 ++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/test/test.py b/test/test.py index cc2616de4..fca1d3aae 100755 --- a/test/test.py +++ b/test/test.py @@ -207,6 +207,12 @@ class PluginTestCase(unittest.TestCase): self.failIf(lastGetHelp in m.args[1], '%r returned the help string.' % query) + def assertHelp(self, query): + m = self._feedMsg(query) + if m is None: + raise TimeoutError, query + self.failUnless(lastGetHelp in m.args[1]) + def assertNoResponse(self, query, timeout=None): m = self._feedMsg(query, timeout) self.failIf(m, 'Unexpected response: %s' % msg.args[1]) diff --git a/test/test_Misc.py b/test/test_Misc.py index d3496bd3c..0f91fa2be 100644 --- a/test/test_Misc.py +++ b/test/test_Misc.py @@ -61,14 +61,14 @@ class MiscTestCase(ChannelPluginTestCase, PluginDocumentation): conf.repylWhenNotCommand = False def testHelp(self): - self.assertNotError('help list') + self.assertHelp('help list') try: original = conf.prefixChars conf.prefixChars = '@' - self.assertNotError('help @list') + self.assertHelp('help @list') finally: conf.prefixChars = original - self.assertNotError('help list') + self.assertHelp('help list') self.assertRegexp('help help', r'^\x02\(help') self.assertError('help morehelp') diff --git a/test/test_callbacks.py b/test/test_callbacks.py index e34981ed7..85bd53f4b 100644 --- a/test/test_callbacks.py +++ b/test/test_callbacks.py @@ -243,8 +243,8 @@ class PrivmsgTestCase(ChannelPluginTestCase): def testHelpDispatching(self): self.irc.addCallback(self.First()) - self.assertNotError('help firstcmd') - self.assertNotError('help first firstcmd') + self.assertHelp('help firstcmd') + self.assertHelp('help first firstcmd') self.irc.addCallback(self.FirstRepeat()) self.assertError('help firstcmd') self.assertRegexp('help first firstcmd', 'First', 0) # no re.I flag.