mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-11 18:06:10 +00:00
expose sock, pass correct args to connect in stubs. should fix httplib2 in python3
This commit is contained in:
@@ -192,7 +192,7 @@ class VCRConnection:
|
|||||||
def set_debuglevel(self, *args, **kwargs):
|
def set_debuglevel(self, *args, **kwargs):
|
||||||
self.real_connection.set_debuglevel(*args, **kwargs)
|
self.real_connection.set_debuglevel(*args, **kwargs)
|
||||||
|
|
||||||
def connect(self):
|
def connect(self, *args, **kwargs):
|
||||||
"""
|
"""
|
||||||
httplib2 uses this. Connects to the server I'm assuming.
|
httplib2 uses this. Connects to the server I'm assuming.
|
||||||
|
|
||||||
@@ -212,7 +212,7 @@ class VCRConnection:
|
|||||||
# Cassette is write-protected, don't actually connect
|
# Cassette is write-protected, don't actually connect
|
||||||
return
|
return
|
||||||
|
|
||||||
return self.real_connection.connect(self)
|
return self.real_connection.connect(*args, **kwargs)
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
# need to temporarily reset here because the real connection
|
# need to temporarily reset here because the real connection
|
||||||
@@ -222,6 +222,7 @@ class VCRConnection:
|
|||||||
reset()
|
reset()
|
||||||
self.real_connection = self._baseclass(*args, **kwargs)
|
self.real_connection = self._baseclass(*args, **kwargs)
|
||||||
install(self.cassette)
|
install(self.cassette)
|
||||||
|
self.sock = self.real_connection.sock
|
||||||
|
|
||||||
|
|
||||||
class VCRHTTPConnection(VCRConnection):
|
class VCRHTTPConnection(VCRConnection):
|
||||||
|
|||||||
Reference in New Issue
Block a user