This involves some more work but should be generally easy to implement. https://github.com/bitcoin/bitcoin/blob/248b8b8390e5d5caedc9fcb82d98e90dc5f1fa47/qa/rpc-tests/rpcbind_test.py#L9