def test_301(self): urlopen = get_url_open() import socket url = self.get_url("/sub") response = open_url(urlopen, get_url_request(), url, 5, socket.timeout) self.assertEqual(200, response.status) self.assertTrue(response.is_redirect)
def test_200(self): urlopen = get_url_open() import socket url = self.get_url("/index.html") response = open_url(urlopen, get_url_request(), url, 5, socket.timeout) self.assertEqual(200, response.status) self.assertTrue(response.exception is None)
def test_301(self): urlopen = get_url_open() import socket url = self.get_url("/sub") response = open_url(urlopen, get_url_request(), url, 5, socket.timeout) self.assertEqual(200, response.status) self.assertTrue(response.is_redirect)
def test_200(self): urlopen = get_url_open() import socket url = self.get_url("/index.html") response = open_url(urlopen, get_url_request(), url, 5, socket.timeout) self.assertEqual(200, response.status) self.assertTrue(response.exception is None)
def test_404(self): urlopen = get_url_open() import socket url = self.get_url("/does_not_exist.html") response = open_url(urlopen, get_url_request(), url, 5, socket.timeout) self.assertEqual(404, response.status) self.assertTrue(response.exception is not None)
def test_404(self): urlopen = get_url_open() import socket url = self.get_url("/does_not_exist.html") response = open_url(urlopen, get_url_request(), url, 5, socket.timeout) self.assertEqual(404, response.status) self.assertTrue(response.exception is not None)