diff --git a/test/test_capability.capnp b/test/test_capability.capnp index 87a2e17..5d3c140 100644 --- a/test/test_capability.capnp +++ b/test/test_capability.capnp @@ -76,4 +76,8 @@ interface TestTailCallee { interface TestTailCaller { foo @0 (i :Int32, callee :TestTailCallee) -> TestTailCallee.TailResult; -} \ No newline at end of file +} + +interface TestPassedCap { + foo @0 (cap :TestInterface) -> (x: Text); +} diff --git a/test/test_capability.py b/test/test_capability.py index 7a21739..61b7906 100644 --- a/test/test_capability.py +++ b/test/test_capability.py @@ -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()