2005-12-07 21:55:16 +00:00
|
|
|
# -*- coding: iso-8859-1 -*-
|
2012-03-09 10:16:18 +00:00
|
|
|
# Copyright (C) 2004-2012 Bastian Kleineidam
|
2005-12-07 21:55:16 +00:00
|
|
|
#
|
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
# (at your option) any later version.
|
|
|
|
|
#
|
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
|
#
|
2009-07-24 21:58:20 +00:00
|
|
|
# You should have received a copy of the GNU General Public License along
|
|
|
|
|
# with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2005-12-07 21:55:16 +00:00
|
|
|
"""
|
|
|
|
|
Test http checking.
|
|
|
|
|
"""
|
2012-09-21 18:34:05 +00:00
|
|
|
from .httpserver import HttpServerTest, CookieRedirectHttpRequestHandler
|
2005-12-07 21:55:16 +00:00
|
|
|
|
2010-03-09 06:43:31 +00:00
|
|
|
class TestHttp (HttpServerTest):
|
2009-07-24 05:21:27 +00:00
|
|
|
"""Test http:// link checking."""
|
2005-12-07 21:55:16 +00:00
|
|
|
|
|
|
|
|
def test_html (self):
|
|
|
|
|
try:
|
2005-12-17 19:22:44 +00:00
|
|
|
self.start_server(handler=CookieRedirectHttpRequestHandler)
|
2008-05-20 17:01:16 +00:00
|
|
|
url = u"http://localhost:%d/tests/checker/data/" \
|
2005-12-17 19:22:44 +00:00
|
|
|
u"http.html" % self.port
|
2005-12-07 21:55:16 +00:00
|
|
|
resultlines = self.get_resultlines("http.html")
|
2011-12-17 15:39:21 +00:00
|
|
|
self.direct(url, resultlines, recursionlevel=1)
|
2008-06-16 19:51:58 +00:00
|
|
|
url = u"http://localhost:%d/tests/checker/data/" \
|
|
|
|
|
u"http.xhtml" % self.port
|
|
|
|
|
resultlines = self.get_resultlines("http.xhtml")
|
2011-12-17 15:39:21 +00:00
|
|
|
self.direct(url, resultlines, recursionlevel=1)
|
2005-12-07 21:55:16 +00:00
|
|
|
finally:
|
|
|
|
|
self.stop_server()
|