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

Random tweaks.

This commit is contained in:
Ivan Malison
2014-10-05 18:37:01 -07:00
parent e9f35db405
commit a9a68ba44b
3 changed files with 25 additions and 19 deletions

View File

@@ -217,11 +217,15 @@ class VCRConnection(object):
response = self.cassette.play_response(self._vcr_request)
return VCRHTTPResponse(response)
else:
if self.cassette.write_protected and self.cassette.filter_request(self._vcr_request):
if self.cassette.write_protected and self.cassette.filter_request(
self._vcr_request
):
raise CannotOverwriteExistingCassetteException(
"No match for the request (%r) was found. "
"Can't overwrite existing cassette (%r) in "
"your current record mode (%r)."
% (self.cassette._path, self.cassette.record_mode)
% (self._vcr_request, self.cassette._path,
self.cassette.record_mode)
)
# Otherwise, we should send the request, then get the response