Ejemplo n.º 1
0
    def load_cassette(cls, cassette_path, serializer):
        if os.path.exists(
                cassette_path) and vcr_mode == 'all' and os.path.basename(
                    cassette_path) not in cls.CASSETTES_TO_NEVER_OVERWRITE:
            os.remove(cassette_path)

        return FilesystemPersister.load_cassette(cassette_path, serializer)
Ejemplo n.º 2
0
 def load_cassette(cassette_path, serializer):
     cassette_path += ".test"
     return FilesystemPersister.load_cassette(cassette_path, serializer)
Ejemplo n.º 3
0
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()
Ejemplo n.º 4
0
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()
Ejemplo n.º 5
0
 def load_cassette(cassette_path, serializer):
     cassette_path += '.test'
     return FilesystemPersister.load_cassette(cassette_path, serializer)