# allows me to compare the entire length of the response to see if it
# exists in the cassette.
+ self._sock = VCRFakeSocket()
+
def putrequest(self, method, url, *args, **kwargs):
"""
httplib gives you more than one way to do it. This is a way
with force_reset():
return self.real_connection.connect(*args, **kwargs)
+ self._sock = VCRFakeSocket()
+
@property
def sock(self):
if self.real_connection.sock:
return self.real_connection.sock
- return VCRFakeSocket()
+ return self._sock
@sock.setter
def sock(self, value):
with force_reset():
self.real_connection = self._baseclass(*args, **kwargs)
+ self._sock = None
+
def __setattr__(self, name, value):
"""
We need to define this because any attributes that are set on the