Add test for returning tuple in server

This commit is contained in:
Jason Paryani
2013-12-11 01:17:23 -08:00
parent 117a3c7eac
commit 5811213321
2 changed files with 10 additions and 0 deletions

View File

@@ -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);
}

View File

@@ -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)