diff --git a/vcr/__init__.py b/vcr/__init__.py index efa5e94..14c6028 100644 --- a/vcr/__init__.py +++ b/vcr/__init__.py @@ -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) diff --git a/vcr/config.py b/vcr/config.py new file mode 100644 index 0000000..a708994 --- /dev/null +++ b/vcr/config.py @@ -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)