mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-09 09:13:23 +00:00
v1.7.3
This commit is contained in:
26
README.rst
26
README.rst
@@ -14,17 +14,18 @@ library <https://github.com/vcr/vcr>`__.
|
|||||||
What it does
|
What it does
|
||||||
------------
|
------------
|
||||||
|
|
||||||
VCR.py simplifies and speeds up tests that make HTTP requests. The first
|
VCR.py simplifies and speeds up tests that make HTTP requests. The
|
||||||
time you run code that is inside a VCR.py context manager or decorated
|
first time you run code that is inside a VCR.py context manager or
|
||||||
function, VCR.py records all HTTP interactions that take place through
|
decorated function, VCR.py records all HTTP interactions that take
|
||||||
the libraries it supports and serializes and writes them to a flat file
|
place through the libraries it supports and serializes and writes them
|
||||||
(in yaml format by default). This flat file is called a cassette. When
|
to a flat file (in yaml format by default). This flat file is called a
|
||||||
the relevant peice of code is executed again, VCR.py will read the
|
cassette. When the relevant peice of code is executed again, VCR.py
|
||||||
serialized requests and responses from the aforementioned cassette file,
|
will read the serialized requests and responses from the
|
||||||
and intercept any HTTP requests that it recognizes from the original
|
aforementioned cassette file, and intercept any HTTP requests that it
|
||||||
test run and return responses that corresponded to those requests. This
|
recognizes from the original test run and return the responses that
|
||||||
means that the requests will not actually result in HTTP traffic, which
|
corresponded to those requests. This means that the requests will not
|
||||||
confers several benefits including:
|
actually result in HTTP traffic, which confers several benefits
|
||||||
|
including:
|
||||||
|
|
||||||
- The ability to work offline
|
- The ability to work offline
|
||||||
- Completely deterministic tests
|
- Completely deterministic tests
|
||||||
@@ -608,6 +609,9 @@ new API in version 1.0.x
|
|||||||
|
|
||||||
Changelog
|
Changelog
|
||||||
---------
|
---------
|
||||||
|
- 1.7.3 [#188] ``additional_matchers`` kwarg on ``use_casstte``.
|
||||||
|
[#191] Actually support passing multiple before_record_request
|
||||||
|
functions (thanks @agriffis).
|
||||||
- 1.7.2 [#186] Get effective_url in tornado (thanks @mvschaik), [#187]
|
- 1.7.2 [#186] Get effective_url in tornado (thanks @mvschaik), [#187]
|
||||||
Set request_time on Response object in tornado (thanks @abhinav).
|
Set request_time on Response object in tornado (thanks @abhinav).
|
||||||
- 1.7.1 [#183] Patch ``fetch_impl`` instead of the entire HTTPClient
|
- 1.7.1 [#183] Patch ``fetch_impl`` instead of the entire HTTPClient
|
||||||
|
|||||||
2
setup.py
2
setup.py
@@ -51,7 +51,7 @@ except Exception:
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='vcrpy',
|
name='vcrpy',
|
||||||
version='1.7.2',
|
version='1.7.3',
|
||||||
description=(
|
description=(
|
||||||
"Automatically mock your HTTP interactions to simplify and "
|
"Automatically mock your HTTP interactions to simplify and "
|
||||||
"speed up testing"
|
"speed up testing"
|
||||||
|
|||||||
@@ -162,6 +162,7 @@ class VCR(object):
|
|||||||
if not isinstance(before_record_response, collections.Iterable):
|
if not isinstance(before_record_response, collections.Iterable):
|
||||||
before_record_response = (before_record_response,)
|
before_record_response = (before_record_response,)
|
||||||
filter_functions.extend(before_record_response)
|
filter_functions.extend(before_record_response)
|
||||||
|
|
||||||
def before_record_response(response):
|
def before_record_response(response):
|
||||||
for function in filter_functions:
|
for function in filter_functions:
|
||||||
if response is None:
|
if response is None:
|
||||||
@@ -221,6 +222,7 @@ class VCR(object):
|
|||||||
if not isinstance(before_record_request, collections.Iterable):
|
if not isinstance(before_record_request, collections.Iterable):
|
||||||
before_record_request = (before_record_request,)
|
before_record_request = (before_record_request,)
|
||||||
filter_functions.extend(before_record_request)
|
filter_functions.extend(before_record_request)
|
||||||
|
|
||||||
def before_record_request(request):
|
def before_record_request(request):
|
||||||
request = copy.copy(request)
|
request = copy.copy(request)
|
||||||
for function in filter_functions:
|
for function in filter_functions:
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ import json
|
|||||||
from six.moves import urllib, xmlrpc_client
|
from six.moves import urllib, xmlrpc_client
|
||||||
from .util import CaseInsensitiveDict, read_body
|
from .util import CaseInsensitiveDict, read_body
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user