1
0
mirror of https://github.com/kevin1024/vcrpy.git synced 2025-12-09 17:15:35 +00:00

added a fix to httplib2

This commit is contained in:
Charly
2017-01-04 17:55:11 -05:00
committed by Kevin McCarthy
parent d86ffe7130
commit e5d6327de9
2 changed files with 12 additions and 1 deletions

View File

@@ -1,4 +1,6 @@
from vcr.stubs import VCRHTTPSConnection from vcr.stubs import VCRHTTPSConnection
from vcr.compat import mock
from vcr.cassette import Cassette
class TestVCRConnection(object): class TestVCRConnection(object):
@@ -7,3 +9,10 @@ class TestVCRConnection(object):
vcr_connection = VCRHTTPSConnection('www.examplehost.com') vcr_connection = VCRHTTPSConnection('www.examplehost.com')
vcr_connection.ssl_version = 'example_ssl_version' vcr_connection.ssl_version = 'example_ssl_version'
assert vcr_connection.real_connection.ssl_version == 'example_ssl_version' assert vcr_connection.real_connection.ssl_version == 'example_ssl_version'
@mock.patch('vcr.cassette.Cassette.can_play_response_for', return_value=False)
def testing_connect(*args):
vcr_connection = VCRHTTPSConnection('www.google.com')
vcr_connection.cassette = Cassette('test', record_mode='all')
vcr_connection.real_connection.connect()
assert vcr_connection.real_connection.sock is not None

View File

@@ -287,7 +287,9 @@ class VCRConnection(object):
# Cassette is write-protected, don't actually connect # Cassette is write-protected, don't actually connect
return return
return self.real_connection.connect(*args, **kwargs) from vcr.patch import force_reset
with force_reset():
return self.real_connection.connect(*args, **kwargs)
@property @property
def sock(self): def sock(self):