Add arguments checking to then callback

This commit is contained in:
Jason Paryani
2014-04-13 18:26:01 -07:00
parent c2b9d14268
commit cfb60cddf0
2 changed files with 21 additions and 0 deletions

View File

@@ -289,3 +289,13 @@ def test_timer():
joined = capnp.join_promises([promise, canceller])
with pytest.raises(Exception):
joined.wait()
def test_then_args():
capnp.Promise(0).then(lambda x: 1)
with pytest.raises(ValueError):
capnp.Promise(0).then(lambda: 1)
with pytest.raises(ValueError):
capnp.Promise(0).then(lambda x, y: 1)