Example #1
0
 def get(self, url, status=200):
     conn = HTTPConnection(self.defaulthost, timeout=5)
     conn.request("GET", url)
     response = conn.getresponse()
     body = response.read()
     conn.close()
     self.assertEqual(response.status, status)
     try:
         body = body.decode()
     except UnicodeDecodeError:
         pass
     return body
Example #2
0
 def follow(self, link):
     if link.startswith('http://'):
         return
     conn = HTTPConnection(WebGuiTest.defaulthost)
     conn.request("GET", link)
     response = conn.getresponse()
     body = response.read()
     conn.close()
     if response.status not in [200, 302, 303, 307]:
         sys.stderr.write('\nLINK-ERROR: %s, %d, %s' % (link, response.status, response.reason))
         if response.status == 500:
             sys.stderr.write(body)
         self.errors += 1
 def follow(self, link):
     if link.startswith("http://"):
         return
     conn = HTTPConnection(WebGuiTest.defaulthost)
     conn.request("GET", link)
     response = conn.getresponse()
     response.read()
     conn.close()
     if response.status not in [200, 302, 303, 307]:
         print("LINK-ERROR:", link, response.status, response.reason)
         self.errors += 1
Example #4
0
 def get(self, url, status=200):
     conn = HTTPConnection(self.defaulthost)
     conn.request("GET", url)
     response = conn.getresponse()
     body = response.read()
     conn.close()
     self.assertEqual(response.status, status)
     try:
         body = body.decode()
     except UnicodeDecodeError:
         pass
     return body
Example #5
0
 def follow(self, link):
     if link.startswith('http://'):
         return
     conn = HTTPConnection(WebGuiTest.defaulthost)
     conn.request("GET", link)
     response = conn.getresponse()
     body = response.read()
     conn.close()
     if response.status not in [200, 302, 303, 307]:
         sys.stderr.write('\nLINK-ERROR: %s, %d, %s' % (link, response.status, response.reason))
         if response.status == 500:
             sys.stderr.write(body)
         self.errors += 1