Skip to content

Commit

Permalink
fix the tests for python 3
Browse files Browse the repository at this point in the history
  • Loading branch information
slingamn committed Aug 6, 2012
1 parent 000c105 commit 291859c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -986,15 +986,15 @@ def test_prefetch_redirect_bug(self):
# this attempt to iterate will crash because the content has already
# been read.
first_line = next(res.iter_lines())
self.assertTrue(first_line.strip().startswith('{'))
self.assertTrue(first_line.strip().decode('utf-8').startswith('{'))

def test_prefetch_return_response_interaction(self):
"""Test that prefetch can be overridden as a kwarg to `send`."""
req = requests.get(httpbin('get'), return_response=False)
req.send(prefetch=False)
# content should not have been prefetched, and iter_lines should succeed
first_line = next(req.response.iter_lines())
self.assertTrue(first_line.strip().startswith('{'))
self.assertTrue(first_line.strip().decode('utf-8').startswith('{'))

if __name__ == '__main__':
unittest.main()

0 comments on commit 291859c

Please sign in to comment.