Fix a test failure.

This commit is contained in:
James Vega 2004-12-10 04:08:36 +00:00
parent df14ebc0d2
commit 78685a323f

View File

@ -67,11 +67,18 @@ class HttpTest(PluginTestCase):
def testTitle(self): def testTitle(self):
self.assertResponse('title http://www.slashdot.org/', self.assertResponse('title http://www.slashdot.org/',
'Slashdot: News for nerds, stuff that matters') 'Slashdot: News for nerds, stuff that matters')
self.assertNotRegexp('title ' # Amazon add a bunch of scripting stuff to the top of their page,
'http://www.amazon.com/exec/obidos/tg/detail/-/' # so we need to allow for a larger peekSize
'1884822312/qid=1063140754/sr=8-1/ref=sr_8_1/' try:
'002-9802970-2308826?v=glance&s=books&n=507846', orig = conf.supybot.protocols.http.peekSize()
'no HTML title') conf.supybot.protocols.http.peekSize.setValue(8192)
self.assertNotRegexp('title '
'http://www.amazon.com/exec/obidos/tg/detail/-/'
'1884822312/qid=1063140754/sr=8-1/ref=sr_8_1/'
'002-9802970-2308826?v=glance&s=books&n=507846',
'no HTML title')
finally:
conf.supybot.protocols.http.peekSize.setValue(orig)
# Checks the non-greediness of the regexp # Checks the non-greediness of the regexp
self.assertResponse('title ' self.assertResponse('title '
'http://www.space.com/scienceastronomy/' 'http://www.space.com/scienceastronomy/'