(transport)
| 354 | |
| 355 | |
| 356 | def test_write_payload_eof(transport): |
| 357 | write = transport.write = mock.Mock() |
| 358 | msg = protocol.Response(transport, 200, http_version=(1, 0)) |
| 359 | msg.send_headers() |
| 360 | |
| 361 | msg.write(b'data1') |
| 362 | assert msg.headers_sent |
| 363 | |
| 364 | msg.write(b'data2') |
| 365 | msg.write_eof() |
| 366 | |
| 367 | content = b''.join([c[1][0] for c in list(write.mock_calls)]) |
| 368 | assert b'data1data2' == content.split(b'\r\n\r\n', 1)[-1] |
| 369 | |
| 370 | |
| 371 | def test_write_payload_chunked(transport): |
nothing calls this directly
no test coverage detected