mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-10 09:35:34 +00:00
Added scheme to default 'match_on'
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import os
|
import os
|
||||||
from .cassette import Cassette
|
from .cassette import Cassette
|
||||||
from .serializers import yamlserializer, jsonserializer
|
from .serializers import yamlserializer, jsonserializer
|
||||||
from .matchers import method, url, host, path, headers, body
|
from . import matchers
|
||||||
|
|
||||||
|
|
||||||
class VCR(object):
|
class VCR(object):
|
||||||
@@ -9,10 +9,17 @@ class VCR(object):
|
|||||||
serializer='yaml',
|
serializer='yaml',
|
||||||
cassette_library_dir=None,
|
cassette_library_dir=None,
|
||||||
record_mode="once",
|
record_mode="once",
|
||||||
match_on=['method', 'host', 'port', 'path', 'query'],
|
|
||||||
filter_headers=[],
|
filter_headers=[],
|
||||||
filter_query_parameters=[],
|
filter_query_parameters=[],
|
||||||
before_record=None,
|
before_record=None,
|
||||||
|
match_on=[
|
||||||
|
'method',
|
||||||
|
'scheme',
|
||||||
|
'host',
|
||||||
|
'port',
|
||||||
|
'path',
|
||||||
|
'query',
|
||||||
|
],
|
||||||
):
|
):
|
||||||
self.serializer = serializer
|
self.serializer = serializer
|
||||||
self.match_on = match_on
|
self.match_on = match_on
|
||||||
@@ -22,14 +29,15 @@ class VCR(object):
|
|||||||
'json': jsonserializer,
|
'json': jsonserializer,
|
||||||
}
|
}
|
||||||
self.matchers = {
|
self.matchers = {
|
||||||
'method': method,
|
'method': matchers.method,
|
||||||
'url': url,
|
'url': matchers.url,
|
||||||
'host': host,
|
'scheme': matchers.scheme,
|
||||||
'port': method,
|
'host': matchers.host,
|
||||||
'path': path,
|
'port': matchers.method,
|
||||||
'query': path,
|
'path': matchers.path,
|
||||||
'headers': headers,
|
'query': matchers.path,
|
||||||
'body': body,
|
'headers': matchers.headers,
|
||||||
|
'body': matchers.body,
|
||||||
}
|
}
|
||||||
self.record_mode = record_mode
|
self.record_mode = record_mode
|
||||||
self.filter_headers = filter_headers
|
self.filter_headers = filter_headers
|
||||||
|
|||||||
Reference in New Issue
Block a user