(self)
| 421 | self.check_read(b"1.1") |
| 422 | |
| 423 | def test_read_bogus(self): |
| 424 | # urlopen() should raise OSError for many error codes. |
| 425 | self.fakehttp(b'''HTTP/1.1 401 Authentication Required |
| 426 | Date: Wed, 02 Jan 2008 03:03:54 GMT |
| 427 | Server: Apache/1.3.33 (Debian GNU/Linux) mod_ssl/2.8.22 OpenSSL/0.9.7e |
| 428 | Connection: close |
| 429 | Content-Type: text/html; charset=iso-8859-1 |
| 430 | ''', mock_close=True) |
| 431 | try: |
| 432 | with self.assertRaises(urllib.error.HTTPError) as cm: |
| 433 | urllib.request.urlopen("http://python.org/") |
| 434 | cm.exception.close() |
| 435 | finally: |
| 436 | self.unfakehttp() |
| 437 | |
| 438 | def test_invalid_redirect(self): |
| 439 | # urlopen() should raise OSError for many error codes. |
nothing calls this directly
no test coverage detected