]> khamidou — GitHub mirrors - vcrpy.git/commitdiff
Added more test for persist
authorMax Shytikov <mshytikov@gmail.com>
Thu, 24 Apr 2014 00:41:35 +0000 (02:41 +0200)
committerMax Shytikov <mshytikov@gmail.com>
Wed, 30 Apr 2014 00:36:27 +0000 (02:36 +0200)
tests/unit/test_persist.py

index 009d4cbe768e6b2178957839090670b41762b756..e9b30bea3ecca698314b42be138acbfe84b2abf4 100644 (file)
@@ -12,3 +12,13 @@ def test_load_cassette_with_old_cassettes(cassette_path, serializer):
     with pytest.raises(ValueError) as excinfo:
         vcr.persist.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:
+        vcr.persist.load_cassette(cassette_path, serializer)
+    assert "run the migration script" not in excinfo.exconly()