mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-10 23:10:42 +01:00
* Work in progress * added file parsing and name validation + adjust schema * Exceptions on bad input * Support multiple parameters * Support multi 's in Having any troubles? Hit us up at https://dvc.org/support, we are always happy to help! * Restyled by black Co-authored-by: elgehelge <[email protected]> Co-authored-by: Restyled.io <[email protected]>
19 lines
578 B
Python
19 lines
578 B
Python
import mock
|
|
|
|
from dvc.dependency import DependencyPARAMS
|
|
from dvc.stage import Stage
|
|
from tests.basic_env import TestDvc
|
|
|
|
|
|
class TestDependencyPARAM(TestDvc):
|
|
def test_from_list(self):
|
|
stage = Stage(self.dvc)
|
|
deps = DependencyPARAMS.from_list(
|
|
stage, ["foo", "bar,baz", "a_file:qux"]
|
|
)
|
|
assert len(deps) == 2
|
|
assert deps[0].def_path == "a_file"
|
|
assert deps[0].param_names == ["qux"]
|
|
assert deps[1].def_path == DependencyPARAMS.DEFAULT_PARAMS_FILE
|
|
assert deps[1].param_names == ["bar", "baz", "foo"]
|