]> khamidou — GitHub mirrors - vcrpy.git/commitdiff
Update stubs.py
authorVitor M. A. da Cruz <vitormazzi@gmail.com>
Fri, 21 Jun 2013 19:54:24 +0000 (16:54 -0300)
committerVitor M. A. da Cruz <vitormazzi@gmail.com>
Fri, 21 Jun 2013 19:54:24 +0000 (16:54 -0300)
`VCRHTTPResponse.close` method must be defined for urllib3.

`VCRHTTPResponse.read` does not need to care about the paremeters passed to it

vcr/stubs.py

index 91ed0e256f2c4e6632898c390012ce97815988ed..898e3502af55412f70a0cb57b2c1722c31e4cdb9 100644 (file)
@@ -21,10 +21,13 @@ class VCRHTTPResponse(object):
 
         self.length = self.msg.getheader('content-length') or None
 
-    def read(self, chunked=False):
+    def read(self, *args, **kwargs):
         # Note: I'm pretty much ignoring any chunking stuff because
         # I don't really understand what it is or how it works.
-        return self._content.read()
+        return self._content.read(*args, **kwargs)
+        
+    def close(self):
+        return True
 
     def isclosed(self):
         # Urllib3 seems to call this because it actually uses