1
0
mirror of https://github.com/kevin1024/vcrpy.git synced 2025-12-09 01:03:24 +00:00

Cassettes now store multiple requests

This commit is contained in:
Kevin McCarthy
2012-06-30 15:10:20 -10:00
parent 66e7ce9572
commit 2576878f2e
6 changed files with 59 additions and 17 deletions

View File

@@ -12,14 +12,15 @@ def install(cassette_path):
httplib.HTTPConnection._vcr_cassette_path = cassette_path
httplib.HTTPSConnection._vcr_cassette_path = cassette_path
def reset():
httplib.HTTPConnection = httplib.HTTP._connection_class = _HTTPConnection
httplib.HTTPSConnection = httplib.HTTPS._connection_class = \
_HTTPSConnection
@contextmanager
def use_cassette(cassette_path):
install(cassette_path)
yield
reset()