From 915d4674e3cdf083e46508fdf5f51526868f041a Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Mon, 9 Feb 2004 03:03:22 +0000 Subject: [PATCH] Added a try/finally block. The snarfer test still needs one added. --- test/test_Sourceforge.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/test/test_Sourceforge.py b/test/test_Sourceforge.py index 01503a8e2..4f8c9e913 100644 --- a/test/test_Sourceforge.py +++ b/test/test_Sourceforge.py @@ -85,7 +85,7 @@ if network: n = re.search('#(\d+)', m.args[1]).group(1) self.assertNotError('rfe --open gaim %s' % n) - ''' + """ Just assume pending works since we're not 99% guaranteed to have a project that has pending bugs/rfes like we do with the others. def testPending(self): @@ -97,7 +97,7 @@ if network: self.failUnless(m, 'No response from Sourceforge.') n = re.search('#(\d+)', m.args[1]).group(1) self.assertNotError('rfe --pending gaim %s' % n) - ''' + """ def testBugs(self): self.assertHelp('bugs') @@ -127,14 +127,17 @@ if network: def testDefaultproject(self): self.assertHelp('bugs') - conf.supybot.plugins.Sourceforge.project.set('supybot') - self.assertNotError('bugs') - m = self.getMsg('bugs') - n = re.search('#(\d+)', m.args[1]).group(1) - self.assertNotError('bug supybot %s' % n) - # This should have the same effect as calling 'bug supybot %s' - self.assertNotError('bug %s' % n) - conf.supybot.plugins.Sourceforge.project.set('') + try: + original = conf.supybot.plugins.Sourceforge.project() + conf.supybot.plugins.Sourceforge.project.set('supybot') + self.assertNotError('bugs') + m = self.getMsg('bugs') + n = re.search('#(\d+)', m.args[1]).group(1) + self.assertNotError('bug supybot %s' % n) + # This should have the same effect as calling 'bug supybot %s' + self.assertNotError('bug %s' % n) + finally: + conf.supybot.plugins.Sourceforge.project.set(original) def testSnarfer(self): s = r'.*Status.*: \w+'