mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-08 16:53:23 +00:00
Format with line length 110 to match flake8 make black part of linting check Update travis spec for updated black requirements Add diff output for black on failure update changelog
31 lines
1.0 KiB
Python
31 lines
1.0 KiB
Python
import pytest
|
|
|
|
from vcr.persisters.filesystem import FilesystemPersister
|
|
from vcr.serializers import jsonserializer, yamlserializer
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
"cassette_path, serializer",
|
|
[
|
|
("tests/fixtures/migration/old_cassette.json", jsonserializer),
|
|
("tests/fixtures/migration/old_cassette.yaml", yamlserializer),
|
|
],
|
|
)
|
|
def test_load_cassette_with_old_cassettes(cassette_path, serializer):
|
|
with pytest.raises(ValueError) as excinfo:
|
|
FilesystemPersister.load_cassette(cassette_path, serializer)
|
|
assert "run the migration script" in excinfo.exconly()
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
"cassette_path, serializer",
|
|
[
|
|
("tests/fixtures/migration/not_cassette.txt", jsonserializer),
|
|
("tests/fixtures/migration/not_cassette.txt", yamlserializer),
|
|
],
|
|
)
|
|
def test_load_cassette_with_invalid_cassettes(cassette_path, serializer):
|
|
with pytest.raises(Exception) as excinfo:
|
|
FilesystemPersister.load_cassette(cassette_path, serializer)
|
|
assert "run the migration script" not in excinfo.exconly()
|