From 5811213321b3a1c15f24c056564ca1d2a05288b1 Mon Sep 17 00:00:00 2001 From: Jason Paryani Date: Wed, 11 Dec 2013 01:17:23 -0800 Subject: [PATCH] Add test for returning tuple in server --- test/test_capability.capnp | 1 + test/test_capability.py | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/test/test_capability.capnp b/test/test_capability.capnp index 8876273..87a2e17 100644 --- a/test/test_capability.capnp +++ b/test/test_capability.capnp @@ -27,6 +27,7 @@ interface TestInterface { foo @0 (i :UInt32, j :Bool) -> (x: Text); bar @1 () -> (); buz @2 (i: TestSturdyRefHostId) -> (x: Text); + bam @3 (i :UInt32, j :Bool) -> (x: Text, i:UInt32); # baz @2 (s: TestAllTypes); } diff --git a/test/test_capability.py b/test/test_capability.py index 01b2fec..a45bc21 100644 --- a/test/test_capability.py +++ b/test/test_capability.py @@ -17,6 +17,9 @@ class Server(capability.TestInterface.Server): def buz(self, i, **kwargs): return i.host + '_test' + def bam(self, i, **kwargs): + return str(i) + '_test', i + class PipelineServer(capability.TestPipeline.Server): def getCap(self, n, inCap, _context, **kwargs): def _then(response): @@ -97,6 +100,12 @@ def test_simple_client(): assert response.x == 'localhost_test' + remote = client.bam(i=5) + response = remote.wait() + + assert response.x == '5_test' + assert response.i == 5 + with pytest.raises(ValueError): remote = client.foo(5, 10)