mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-12-05 15:28:28 +01:00
add metadata fields: label, type to data (#8232)
gto like metadata fields: labels and type
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
import pytest
|
||||
|
||||
from dvc.cli import parse_args
|
||||
from tests.utils.asserts import called_once_with_subset
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"func, args",
|
||||
[
|
||||
("add", ("add", "model.pkl")),
|
||||
("imp", ("import", "https://github.com/org/repo", "model.pkl")),
|
||||
("imp_url", ("import-url", "https://dvc.org/data.xml", "data.xml")),
|
||||
],
|
||||
ids=["add", "import", "import-url"],
|
||||
)
|
||||
def test_add_annotations(mocker, func, args):
|
||||
mocker.patch("dvc.repo.Repo")
|
||||
cli_args = parse_args(
|
||||
[
|
||||
*args,
|
||||
"--label",
|
||||
"example-get-started",
|
||||
"--label",
|
||||
"model-registry",
|
||||
"--type",
|
||||
"model",
|
||||
"--desc",
|
||||
"description",
|
||||
]
|
||||
)
|
||||
|
||||
_, *posargs = args
|
||||
cmd = cli_args.func(cli_args)
|
||||
|
||||
assert cmd.run() == 0
|
||||
assert called_once_with_subset(
|
||||
getattr(cmd.repo, func),
|
||||
posargs,
|
||||
desc="description",
|
||||
type="model",
|
||||
labels=["example-get-started", "model-registry"],
|
||||
)
|
||||
Reference in New Issue
Block a user