mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-09 09:13:23 +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 .cassette import Cassette
|
||||
from config import VCR
|
||||
|
||||
default_vcr = VCR()
|
||||
|
||||
# Also, make a 'load' function available
|
||||
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