From 4c3432b759ccd58ebdaf443167cca07ff17c63ea Mon Sep 17 00:00:00 2001 From: schlamar Date: Wed, 10 Apr 2013 08:20:34 +0200 Subject: [PATCH] Fix test with StringIO. --- test_requests.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test_requests.py b/test_requests.py index 5a0ed98..5440347 100644 --- a/test_requests.py +++ b/test_requests.py @@ -380,6 +380,11 @@ class RequestsTestCase(unittest.TestCase): def test_response_is_iterable(self): r = requests.Response() io = StringIO.StringIO('abc') + read_ = io.read + + def read_mock(amt, decode_content=None): + return read_(amt) + setattr(io, 'read', read_mock) r.raw = io self.assertTrue(next(iter(r))) io.close() -- 2.7.4