api: Add exp_save.

This commit is contained in:
David de la Iglesia Castro
2023-03-23 10:33:55 +01:00
parent 5c442cb867
commit 9b329d01bf
3 changed files with 58 additions and 1 deletions
+18
View File
@@ -0,0 +1,18 @@
import pytest
from dvc import api
from dvc.repo.experiments.exceptions import ExperimentExistsError
def test_exp_save(tmp_dir, dvc, scm, mocker):
tmp_dir.scm_gen({"foo": "foo"}, commit="initial")
api.exp_save()
api.exp_save("foo")
with pytest.raises(
ExperimentExistsError,
match="Experiment conflicts with existing experiment 'foo'.",
):
api.exp_save("foo")
api.exp_save("foo", force=True)