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/'