Esempio n. 1
0
    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)
Esempio n. 2
0
    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)
Esempio n. 3
0
    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)