mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-09 01:03:24 +00:00
Begin work on implementing configuration interface
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
# Import Cassette to make it available at the top level
|
from config import VCR
|
||||||
from .cassette import Cassette
|
|
||||||
|
default_vcr = VCR()
|
||||||
|
|
||||||
# Also, make a 'load' function available
|
# Also, make a 'load' function available
|
||||||
def use_cassette(path, **kwargs):
|
def use_cassette(path, **kwargs):
|
||||||
return Cassette.load(path, **kwargs)
|
return default_vcr.use_cassette(path, **kwargs)
|
||||||
|
|||||||
9
vcr/config.py
Normal file
9
vcr/config.py
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
from .cassette import Cassette
|
||||||
|
|
||||||
|
class VCR(object):
|
||||||
|
def __init__(self, serializer='yaml', cassette_library_dir=None):
|
||||||
|
self.serializer = serializer
|
||||||
|
self.cassette_library_dir = cassette_library_dir
|
||||||
|
|
||||||
|
def use_cassette(self, path, **kwargs):
|
||||||
|
return Cassette.load(path, **kwargs)
|
||||||
Reference in New Issue
Block a user