test/test_Souceforge.py: Removed the commented out tests

plugins/Sourceforge.py: Reverted the snarfer RE back to how it was, with a
slight improvement. This should make it catch more URLs without having all the
negative feedback the last RE produced.
This commit is contained in:
James Vega 2003-10-22 12:34:22 +00:00
parent f9bd4db612
commit f57aba4c80
2 changed files with 1 additions and 27 deletions

View File

@ -246,7 +246,7 @@ class Sourceforge(callbacks.PrivmsgCommandAndRegexp):
_sfTitle = re.compile(r'Detail:(\d+) - ([^<]+)</title>', re.I)
_linkType = re.compile(r'(\w+ \w+|\w+): Tracker Detailed View', re.I)
def sfSnarfer(self, irc, msg, match):
r"https?://(?:www\.)?(?:sourceforge|sf)\.net/tracker/\S+"
r"https?://(?:www\.)?(?:sourceforge|sf)\.net/tracker/(?:index\.php)?\?(?:&?func=detail|&?aid=\d+|&?group_id=\d+|&?atid=\d+)+"
if not self.snarfer:
return
url = match.group(0)

View File

@ -77,32 +77,6 @@ class SourceforgeTest(PluginTestCase, PluginDocumentation):
self.assertNotError('http://sf.net/tracker/?'\
'func=detail&aid=540223&group_id=235&atid=300235')
# test that it works
## def testHttpsSnarfer(self):
## s = r';.*Status.*: \w+;'
## self.assertRegexp('https://sourceforge.net/tracker/index.php?'\
## 'func=detail&aid=589953&group_id=58965&atid=489447', s)
## self.assertRegexp('https://sourceforge.net/tracker/index.php?'\
## 'func=detail&aid=712761&group_id=58965&atid=489450', s)
## self.assertRegexp('https://sourceforge.net/tracker/index.php?'\
## 'func=detail&aid=540223&group_id=235&atid=300235', s)
## self.assertRegexp('https://sourceforge.net/tracker/index.php?'\
## 'func=detail&aid=561547&group_id=235&atid=200235', s)
## self.assertRegexp('http://sourceforge.net/tracker/index.php?'\
## 'func=detail&aid=400942&group_id=235&atid=390395', s)
## # test that it works without index.php
## self.assertNotError('https://sourceforge.net/tracker/?'\
## 'func=detail&aid=540223&group_id=235&atid=300235')
## # test that it works with www
## self.assertNotError('https://www.sourceforge.net/tracker/?'\
## 'func=detail&aid=540223&group_id=235&atid=300235')
## # test that it works with www and without index.php
## self.assertNotError('https://www.sourceforge.net/tracker/index.php?'\
## 'func=detail&aid=540223&group_id=235&atid=300235')
## # test that it works with www and without index.php
## self.assertNotError('https://sf.net/tracker/index.php?'\
## 'func=detail&aid=540223&group_id=235&atid=300235')
self.assertNotError('https://sourceforge.net/tracker/?'
'func=detail&atid=105470&aid=827260&group_id=5470')