Web: Remove/update non-functional tests

Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
This commit is contained in:
James McCoy 2012-09-05 21:35:56 -04:00
parent 5bb6fdcd52
commit d73a801d8f

View File

@ -49,28 +49,8 @@ class WebTestCase(ChannelPluginTestCase):
self.assertNotError('size http://www.slashdot.org/') self.assertNotError('size http://www.slashdot.org/')
def testTitle(self): def testTitle(self):
self.assertResponse('title http://www.slashdot.org/', self.assertRegexp('title http://www.slashdot.org/',
'Slashdot - News for nerds, stuff that matters') 'News for nerds, stuff that matters')
# Amazon add a bunch of scripting stuff to the top of their page,
# so we need to allow for a larger peekSize
# Actually, screw Amazon. Even bumping this up to 10k doesn't give us enough
# info.
# 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/'
'jupiter_dark_spot_031023.html',
'SPACE.com -- Mystery Spot on Jupiter Baffles '
'Astronomers')
# Checks for @title not-working correctly # Checks for @title not-working correctly
self.assertResponse('title ' self.assertResponse('title '
'http://www.catb.org/~esr/jargon/html/F/foo.html', 'http://www.catb.org/~esr/jargon/html/F/foo.html',
@ -97,9 +77,8 @@ class WebTestCase(ChannelPluginTestCase):
def testTitleSnarfer(self): def testTitleSnarfer(self):
try: try:
conf.supybot.plugins.Web.titleSnarfer.setValue(True) conf.supybot.plugins.Web.titleSnarfer.setValue(True)
self.assertSnarfResponse('http://microsoft.com/', self.assertSnarfRegexp('http://microsoft.com/',
'Title: Microsoft Corporation' 'Title: Microsoft Corporation')
' (at microsoft.com)')
finally: finally:
conf.supybot.plugins.Web.titleSnarfer.setValue(False) conf.supybot.plugins.Web.titleSnarfer.setValue(False)