(caplog_async)
| 77 | |
| 78 | |
| 79 | async def test_tcp_start_stop(caplog_async): |
| 80 | caplog_async.set_level("INFO") |
| 81 | manager = MagicMock() |
| 82 | |
| 83 | with taddons.context(): |
| 84 | inst = ServerInstance.make("regular@127.0.0.1:0", manager) |
| 85 | await inst.start() |
| 86 | assert inst.last_exception is None |
| 87 | assert await caplog_async.await_log("proxy listening") |
| 88 | |
| 89 | host, port, *_ = inst.listen_addrs[0] |
| 90 | reader, writer = await asyncio.open_connection(host, port) |
| 91 | assert await caplog_async.await_log("client connect") |
| 92 | |
| 93 | writer.close() |
| 94 | await writer.wait_closed() |
| 95 | assert await caplog_async.await_log("client disconnect") |
| 96 | |
| 97 | await inst.stop() |
| 98 | assert await caplog_async.await_log("stopped") |
| 99 | |
| 100 | |
| 101 | async def test_tcp_timeout(caplog_async): |
nothing calls this directly
no test coverage detected
searching dependent graphs…