Add null capability test
This commit is contained in:
@@ -76,4 +76,8 @@ interface TestTailCallee {
|
||||
|
||||
interface TestTailCaller {
|
||||
foo @0 (i :Int32, callee :TestTailCallee) -> TestTailCallee.TailResult;
|
||||
}
|
||||
}
|
||||
|
||||
interface TestPassedCap {
|
||||
foo @0 (cap :TestInterface) -> (x: Text);
|
||||
}
|
||||
|
||||
@@ -343,3 +343,18 @@ def test_inheritance():
|
||||
response = remote.wait()
|
||||
|
||||
assert response.x == '26'
|
||||
|
||||
|
||||
class TestPassedCap(capability.TestPassedCap.Server):
|
||||
def foo(self, cap, _context, **kwargs):
|
||||
def set_result(res):
|
||||
_context.results.x = res.x
|
||||
return cap.foo(5).then(set_result)
|
||||
|
||||
|
||||
def test_null_cap():
|
||||
client = capability.TestPassedCap._new_client(TestPassedCap())
|
||||
assert client.foo(Server()).wait().x == '26'
|
||||
|
||||
with pytest.raises(capnp.KjException):
|
||||
client.foo().wait()
|
||||
|
||||
Reference in New Issue
Block a user