(self)
| 1031 | self.assertEqual(e.consumed, e2.consumed) |
| 1032 | |
| 1033 | def test_wait_closed_on_close(self): |
| 1034 | with test_utils.run_test_server() as httpd: |
| 1035 | rd, wr = self.loop.run_until_complete( |
| 1036 | asyncio.open_connection(*httpd.address)) |
| 1037 | |
| 1038 | wr.write(b'GET / HTTP/1.0\r\n\r\n') |
| 1039 | f = rd.readline() |
| 1040 | data = self.loop.run_until_complete(f) |
| 1041 | self.assertEqual(data, b'HTTP/1.0 200 OK\r\n') |
| 1042 | f = rd.read() |
| 1043 | data = self.loop.run_until_complete(f) |
| 1044 | self.assertEndsWith(data, b'\r\n\r\nTest message') |
| 1045 | self.assertFalse(wr.is_closing()) |
| 1046 | wr.close() |
| 1047 | self.assertTrue(wr.is_closing()) |
| 1048 | self.loop.run_until_complete(wr.wait_closed()) |
| 1049 | |
| 1050 | def test_wait_closed_on_close_with_unread_data(self): |
| 1051 | with test_utils.run_test_server() as httpd: |
nothing calls this directly
no test coverage detected