A helper class to wrap the RPCServer and manage its lifecycle.
| 11 | |
| 12 | |
| 13 | class RpcServerWrapper(RPCServer): |
| 14 | """ A helper class to wrap the RPCServer and manage its lifecycle. """ |
| 15 | |
| 16 | def __init__(self, *args, **kwargs): |
| 17 | super().__init__(*args, **kwargs) |
| 18 | self.addr = get_unique_ipc_addr() |
| 19 | |
| 20 | def __enter__(self): |
| 21 | self.bind(self.addr) |
| 22 | self.start() |
| 23 | return self |
| 24 | |
| 25 | def __exit__(self, exc_type, exc_value, traceback): |
| 26 | self.shutdown() |
| 27 | |
| 28 | |
| 29 | class TestRpcBasics: |
no outgoing calls