File: yamlserializer.py

package info (click to toggle)
vcr.py 4.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,008 kB
  • sloc: python: 5,695; makefile: 179; sh: 1
file content (15 lines) | stat: -rw-r--r-- 343 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import yaml

# Use the libYAML versions if possible
try:
    from yaml import CLoader as Loader, CDumper as Dumper
except ImportError:
    from yaml import Loader, Dumper


def deserialize(cassette_string):
    return yaml.load(cassette_string, Loader=Loader)


def serialize(cassette_dict):
    return yaml.dump(cassette_dict, Dumper=Dumper)