1
0
mirror of https://github.com/kevin1024/vcrpy.git synced 2025-12-08 16:53:23 +00:00
Files
vcrpy/vcr/persisters/filesystem.py
Kevin McCarthy 49929e3064 formatting fixes
2013-12-01 14:38:46 -10:00

13 lines
333 B
Python

import tempfile
import os
class FilesystemPersister(object):
@classmethod
def write(cls, cassette_path, data):
dirname, filename = os.path.split(cassette_path)
if dirname and not os.path.exists(dirname):
os.makedirs(dirname)
with open(cassette_path, 'w') as f:
f.write(data)