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)
def load_cassette(cassette_path, serializer): cassette_path += ".test" return FilesystemPersister.load_cassette(cassette_path, serializer)
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()
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()
def load_cassette(cassette_path, serializer): cassette_path += '.test' return FilesystemPersister.load_cassette(cassette_path, serializer)