Skip to content

Commit

Permalink
tests: imap test for exception handler returns value
Browse files Browse the repository at this point in the history
  • Loading branch information
rtdean committed Jul 9, 2014
1 parent 785a8d6 commit d7f52c1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests.py
Expand Up @@ -202,6 +202,18 @@ def exception_handler(request, exception):
out.append(r)
self.assertEquals(out, [])

def test_imap_timeout_exception_handler_returns_value(self):
"""
ensure behaviour for a handler that returns a value
"""
def exception_handler(request, exception):
return request
reqs = [grequests.get(httpbin('delay/1'), timeout=0.001)]
out = []
for r in grequests.imap(reqs, exception_handler=exception_handler):
out.append(r)
self.assertEquals(out, [])

def test_map_timeout_exception(self):
class ExceptionHandler:
def __init__(self):
Expand Down

0 comments on commit d7f52c1

Please sign in to comment.