(self)
| 370 | conn.putheader(name, value) |
| 371 | |
| 372 | def test_headers_debuglevel(self): |
| 373 | body = ( |
| 374 | b'HTTP/1.1 200 OK\r\n' |
| 375 | b'First: val\r\n' |
| 376 | b'Second: val1\r\n' |
| 377 | b'Second: val2\r\n' |
| 378 | ) |
| 379 | sock = FakeSocket(body) |
| 380 | resp = client.HTTPResponse(sock, debuglevel=1) |
| 381 | with support.captured_stdout() as output: |
| 382 | resp.begin() |
| 383 | lines = output.getvalue().splitlines() |
| 384 | self.assertEqual(lines[0], "reply: 'HTTP/1.1 200 OK\\r\\n'") |
| 385 | self.assertEqual(lines[1], "header: First: val") |
| 386 | self.assertEqual(lines[2], "header: Second: val1") |
| 387 | self.assertEqual(lines[3], "header: Second: val2") |
| 388 | |
| 389 | def test_max_response_headers(self): |
| 390 | max_headers = client._MAXHEADERS + 20 |
nothing calls this directly
no test coverage detected