()
| 634 | new_tr.close() |
| 635 | |
| 636 | async def run_main(): |
| 637 | on_con = self.loop.create_future() |
| 638 | on_con_lost = self.loop.create_future() |
| 639 | on_got_hello = self.loop.create_future() |
| 640 | proto = ServerProto(on_con, on_con_lost, on_got_hello) |
| 641 | |
| 642 | server = await self.loop.create_server( |
| 643 | lambda: proto, '127.0.0.1', 0) |
| 644 | addr = server.sockets[0].getsockname() |
| 645 | |
| 646 | with self.tcp_client(lambda sock: client(sock, addr), |
| 647 | timeout=self.TIMEOUT): |
| 648 | await asyncio.wait_for( |
| 649 | main(proto, on_con, on_con_lost, on_got_hello), |
| 650 | timeout=self.TIMEOUT) |
| 651 | |
| 652 | server.close() |
| 653 | await server.wait_closed() |
| 654 | self.assertEqual(answer, ANSWER) |
| 655 | |
| 656 | self.loop.run_until_complete(run_main()) |
| 657 |
nothing calls this directly
no test coverage detected