eBay changed their expired auction message

This commit is contained in:
James Vega 2005-01-04 18:50:51 +00:00
parent 20bcb697a1
commit d59310603c
2 changed files with 4 additions and 3 deletions

View File

@ -81,7 +81,7 @@ class Ebay(callbacks.PrivmsgCommandAndRegexp):
_reopts = re.I | re.S
_invalid = re.compile(r'(is invalid, still pending, or no longer in our '
r'database)', _reopts)
r'database|has been removed by eBay)', _reopts)
_info = re.compile(r'<title>eBay item (\d+) \([^)]+\) - ([^<]+)</title>',
_reopts)
@ -137,7 +137,7 @@ class Ebay(callbacks.PrivmsgCommandAndRegexp):
resp = []
m = self._invalid.search(s)
if m:
raise EbayError, 'That auction %s' % m.group(1)
raise EbayError, 'That auction %s.' % m.group(1)
m = self._info.search(s)
if m:
(num, desc) = m.groups()

View File

@ -35,7 +35,8 @@ class EbayTest(ChannelPluginTestCase):
def testAuction(self):
self.assertNotError('auction 3053641570')
# test 'Invalid Item' checking
self.assertRegexp('auction 2357056673', 'That auction is invalid')
self.assertRegexp('auction 2357056673',
r'That auction (is invalid|has been removed)')
self.assertError('auction foobar')
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78: