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):
self.assertResponse('title http://www.slashdot.org/',
'Slashdot: News for nerds, stuff that matters')
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')
# Amazon add a bunch of scripting stuff to the top of their page,
# so we need to allow for a larger peekSize
try:
orig = conf.supybot.protocols.http.peekSize()
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
self.assertResponse('title '
'http://www.space.com/scienceastronomy/'