mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
exp: abstract random name gen from repo
This commit is contained in:
committed by
David de la Iglesia Castro
parent
009b238807
commit
5d2ca11557
File diff suppressed because one or more lines are too long
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user