exp: abstract random name gen from repo

This commit is contained in:
dberenbaum
2023-08-06 13:13:11 +02:00
committed by David de la Iglesia Castro
parent 009b238807
commit 5d2ca11557
2 changed files with 20 additions and 5 deletions
File diff suppressed because one or more lines are too long
+12 -1
View File
@@ -1,8 +1,15 @@
import re
import pytest
from dvc.exceptions import InvalidArgumentError
from dvc.repo.experiments.refs import EXPS_NAMESPACE, ExpRefInfo
from dvc.repo.experiments.utils import check_ref_format, resolve_name, to_studio_params
from dvc.repo.experiments.utils import (
check_ref_format,
gen_random_name,
resolve_name,
to_studio_params,
)
def commit_exp_ref(tmp_dir, scm, file="foo", contents="foo", name="foo"):
@@ -74,3 +81,7 @@ def test_run_check_ref_format(scm, name, result):
)
def test_to_studio_params(params, expected):
assert to_studio_params(params) == expected
def test_gen_random_name():
assert re.match("[a-zA-Z]+-[a-zA-Z]+", gen_random_name())