Fix test with StringIO.
authorschlamar <marc.schlaich@gmail.com>
Wed, 10 Apr 2013 06:20:34 +0000 (08:20 +0200)
committerschlamar <marc.schlaich@gmail.com>
Wed, 10 Apr 2013 06:24:33 +0000 (08:24 +0200)
test_requests.py

index 5a0ed98062897c53288e9547f9af602810b923ed..5440347af38e94a0457baa516ec04b889b66b41e 100644 (file)
@@ -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()