mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-02 17:29:22 +01:00
Fixed bug in tests; it was caused by the prefix character being snarfed in along with the URL.
This commit is contained in:
parent
8c10948d2e
commit
4cc9579582
@ -101,7 +101,7 @@ class URL(callbacks.Privmsg, plugins.Configurable, plugins.ChannelDBHandler):
|
||||
db.commit()
|
||||
return db
|
||||
|
||||
_urlRe = re.compile(r"([^\[<(\s]+://[^\])>\s]+)", re.I)
|
||||
_urlRe = re.compile(r"(\w+://[^\])>\s]+)", re.I)
|
||||
def doPrivmsg(self, irc, msg):
|
||||
channel = msg.args[0]
|
||||
db = self.getDb(channel)
|
||||
@ -153,6 +153,7 @@ class URL(callbacks.Privmsg, plugins.Configurable, plugins.ChannelDBHandler):
|
||||
_tinyRe = re.compile(r'(http://tinyurl.com/\w{4})</blockquote>')
|
||||
def _getTinyUrl(self, url, cmd=False):
|
||||
try:
|
||||
#debug.printf('Trying to get tinyurl for %r' % url)
|
||||
fd = urllib2.urlopen('http://tinyurl.com/create.php?url=%s' % url)
|
||||
s = fd.read()
|
||||
fd.close()
|
||||
|
@ -109,13 +109,7 @@ if sqlite is not None:
|
||||
self.assertRegexp('url tiny http://sourceforge.net/tracker/?'
|
||||
'func=add&group_id=58965&atid=489447',
|
||||
r'http://tinyurl.com/rqac')
|
||||
self.assertRegexp('url tiny http://sourceforge.net/tracker/?'
|
||||
'func=add&group_id=58965&atid=489447',
|
||||
r'http://tinyurl.com/rqac')
|
||||
|
||||
|
||||
class URLTestCase2(ChannelPluginTestCase, PluginDocumentation):
|
||||
plugins = ('URL',)
|
||||
def testTinysnarf(self):
|
||||
self.assertNotError('url config tinyurlsnarfer on')
|
||||
self.assertRegexp('http://www.urbandictionary.com/define.php?'
|
||||
|
Loading…
Reference in New Issue
Block a user