mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-19 15:28:28 +01:00
api: Add exp_save.
This commit is contained in:
@@ -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)
|
||||
Reference in New Issue
Block a user