Refactor interop tests and factories

- Add `close` and `disconnect` in `Host`
- Add `close` and `close_peer` in `Network`
- Change `IListener.close` to async, to await for server's closing
- Add factories for security transports, and modify `HostFactory`
This commit is contained in:
mhchia
2019-08-29 21:38:06 +08:00
parent 64c0dab3af
commit c61a06706a
15 changed files with 184 additions and 116 deletions

View File

@ -71,3 +71,11 @@ class IHost(ABC):
:param peer_info: peer_info of the host we want to connect to
:type peer_info: peer.peerinfo.PeerInfo
"""
@abstractmethod
async def disconnect(self, peer_id: ID) -> None:
pass
@abstractmethod
async def close(self) -> None:
pass