Add test for returning tuple in server
This commit is contained in:
@@ -27,6 +27,7 @@ interface TestInterface {
|
|||||||
foo @0 (i :UInt32, j :Bool) -> (x: Text);
|
foo @0 (i :UInt32, j :Bool) -> (x: Text);
|
||||||
bar @1 () -> ();
|
bar @1 () -> ();
|
||||||
buz @2 (i: TestSturdyRefHostId) -> (x: Text);
|
buz @2 (i: TestSturdyRefHostId) -> (x: Text);
|
||||||
|
bam @3 (i :UInt32, j :Bool) -> (x: Text, i:UInt32);
|
||||||
# baz @2 (s: TestAllTypes);
|
# baz @2 (s: TestAllTypes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,9 @@ class Server(capability.TestInterface.Server):
|
|||||||
def buz(self, i, **kwargs):
|
def buz(self, i, **kwargs):
|
||||||
return i.host + '_test'
|
return i.host + '_test'
|
||||||
|
|
||||||
|
def bam(self, i, **kwargs):
|
||||||
|
return str(i) + '_test', i
|
||||||
|
|
||||||
class PipelineServer(capability.TestPipeline.Server):
|
class PipelineServer(capability.TestPipeline.Server):
|
||||||
def getCap(self, n, inCap, _context, **kwargs):
|
def getCap(self, n, inCap, _context, **kwargs):
|
||||||
def _then(response):
|
def _then(response):
|
||||||
@@ -97,6 +100,12 @@ def test_simple_client():
|
|||||||
|
|
||||||
assert response.x == 'localhost_test'
|
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):
|
with pytest.raises(ValueError):
|
||||||
remote = client.foo(5, 10)
|
remote = client.foo(5, 10)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user