mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-09 09:13:23 +00:00
forgot to check in tests
This commit is contained in:
21
tests/unit/test_serialize.py
Normal file
21
tests/unit/test_serialize.py
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
import pytest
|
||||||
|
from vcr.serialize import deserialize
|
||||||
|
from vcr.serializers import yamlserializer, jsonserializer
|
||||||
|
|
||||||
|
def test_deserialize_old_yaml_cassette():
|
||||||
|
with open('tests/fixtures/migration/old_cassette.yaml', 'r') as f:
|
||||||
|
with pytest.raises(ValueError):
|
||||||
|
deserialize(f.read(), yamlserializer)
|
||||||
|
|
||||||
|
def test_deserialize_old_json_cassette():
|
||||||
|
with open('tests/fixtures/migration/old_cassette.json', 'r') as f:
|
||||||
|
with pytest.raises(ValueError):
|
||||||
|
deserialize(f.read(), jsonserializer)
|
||||||
|
|
||||||
|
def test_deserialize_new_yaml_cassette():
|
||||||
|
with open('tests/fixtures/migration/new_cassette.yaml', 'r') as f:
|
||||||
|
deserialize(f.read(), yamlserializer)
|
||||||
|
|
||||||
|
def test_deserialize_new_json_cassette():
|
||||||
|
with open('tests/fixtures/migration/new_cassette.json', 'r') as f:
|
||||||
|
deserialize(f.read(), jsonserializer)
|
||||||
Reference in New Issue
Block a user