Skip to content

Commit

Permalink
Added extra test for #26
Browse files Browse the repository at this point in the history
  • Loading branch information
syrusakbary committed Apr 12, 2017
1 parent 0560c70 commit 653ce19
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/test_extra.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,18 @@ def test_promisify_function_rejected(resolve):
assert str(exc_info_promise.value) == str(exc_info.value)


def test_promises_with_only_then():
context = {"success": False}
error = RuntimeError("Ooops!")
promise1 = Promise(lambda resolve, reject: context.update({"promise1_reject": reject}))
promise2 = promise1.then(lambda x: None)
promise3 = promise1.then(lambda x: None)
context["promise1_reject"](error)

promise1._wait()
assert promise2.reason == error
assert promise3.reason == error

# def test_promise_loop():
# values = Promise.resolve([1, None, 2])
# def on_error(error):
Expand Down

0 comments on commit 653ce19

Please sign in to comment.