Skip to content

Commit

Permalink
Improved edge cases in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
syrusakbary committed May 3, 2016
1 parent 127d5ca commit d0d92e3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_extra.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,10 @@ def test_is_thenable_future():
assert is_thenable(promise)


def test_is_thenable_simple_object():
assert not is_thenable(object())


def test_promisify_promise():
promise = Promise()
assert promisify(promise) == promise
Expand Down Expand Up @@ -443,3 +447,9 @@ def test_promisify_future_rejected():
future.set_exception(Exception('Future rejected'))
assert promise.is_rejected
assert_exception(promise.reason, Exception, 'Future rejected')


def test_promisify_object():
with pytest.raises(TypeError) as excinfo:
promisify(object())
assert str(excinfo.value) == "Object is not a Promise like object."

0 comments on commit d0d92e3

Please sign in to comment.