From 78685a323f722ef09e6ee9bbf9b1401caa15dc2b Mon Sep 17 00:00:00 2001 From: James Vega Date: Fri, 10 Dec 2004 04:08:36 +0000 Subject: [PATCH] Fix a test failure. --- test/test_Http.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/test/test_Http.py b/test/test_Http.py index 2797f168c..56533f047 100644 --- a/test/test_Http.py +++ b/test/test_Http.py @@ -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/'