Let TwoParty Clients and Servers take ReaderOptions

This commit is contained in:
Alex Silverstein
2017-01-22 01:57:01 +00:00
parent 455ffdf4ab
commit 0382beb26a
3 changed files with 46 additions and 54 deletions

View File

@@ -43,6 +43,24 @@ def test_simple_rpc():
assert response.x == '125'
def test_simple_rpc_with_options():
read, write = socket.socketpair(socket.AF_UNIX)
restorer = SimpleRestorer()
server = capnp.TwoPartyServer(write, restorer)
# This traversal limit is too low to receive the response in, so we expect
# an exception during the call.
client = capnp.TwoPartyClient(read, traversal_limit_in_words=1)
ref = test_capability_capnp.TestSturdyRefObjectId.new_message(tag='testInterface')
cap = client.restore(ref)
cap = cap.cast_as(test_capability_capnp.TestInterface)
remote = cap.foo(i=5)
with pytest.raises(capnp.KjException):
response = remote.wait()
def test_simple_rpc_restore_func():
read, write = socket.socketpair(socket.AF_UNIX)