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