mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Fixed the bug in acronym for the change in format and tightened the test to catch such changes.
This commit is contained in:
parent
4ed97b0ba5
commit
7784d21cde
@ -264,7 +264,7 @@ class Http(callbacks.Privmsg):
|
||||
quote = ' // '.join(quote.splitlines())
|
||||
irc.reply(msg, quote)
|
||||
|
||||
_acronymre = re.compile(r'<td[^w]+width="70[^>]+>(?:<b>)?([^<]+)(?:</b>)?')
|
||||
_acronymre = re.compile(r'width="71%" bgcolor="[^"]+">(?:<b>)?([^<]+)')
|
||||
def acronym(self, irc, msg, args):
|
||||
"""<acronym>
|
||||
|
||||
@ -284,7 +284,7 @@ class Http(callbacks.Privmsg):
|
||||
defs[i] = s.split('is ', 1)[1]
|
||||
#debug.printf(defs)
|
||||
if len(defs) == 0:
|
||||
irc.reply(msg, 'No definitions found.')
|
||||
irc.reply(msg,'No definitions found. (%s)'%conf.replyPossibleBug)
|
||||
else:
|
||||
s = ', or '.join(defs)
|
||||
irc.reply(msg, '%s could be %s' % (acronym, s))
|
||||
|
@ -66,6 +66,7 @@ class HttpTest(PluginTestCase, PluginDocumentation):
|
||||
self.assertError('geekquote --id=48a')
|
||||
|
||||
def testAcronym(self):
|
||||
self.assertRegexp('acronym ASAP', 'as soon as possible')
|
||||
self.assertNotError('acronym PERL')
|
||||
self.assertNotRegexp('acronym UNIX', 'not an acronym')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user