MCPcopy
hub / github.com/treeverse/dvc / test_parametrized

Function test_parametrized

tests/func/test_dataset.py:417–474  ·  view source on GitHub ↗
(tmp_dir, dvc)

Source from the content-addressed store, hash-verified

415
416
417def test_parametrized(tmp_dir, dvc):
418 (tmp_dir / "dvc.yaml").dump(
419 {
420 "datasets": [
421 {"name": "${ds1.name}", "url": "${ds1.url}", "type": "dc"},
422 {
423 "name": "${ds2.name}",
424 "url": "${ds2.url}",
425 "type": "dvc",
426 "path": "${ds2.path}",
427 },
428 {
429 "name": "${ds3.name}",
430 "url": "${ds3.url}",
431 "type": "url",
432 },
433 ]
434 }
435 )
436 (tmp_dir / "params.yaml").dump(
437 {
438 "ds1": {"name": "dogs", "url": "dc://dogs"},
439 "ds2": {
440 "name": "example-get-started",
441 "url": "git@github.com:iterative/example-get-started.git",
442 "path": "path",
443 },
444 "ds3": {
445 "name": "cloud-versioning-demo",
446 "url": "s3://cloud-versioning-demo",
447 },
448 }
449 )
450
451 path = (tmp_dir / "dvc.yaml").fs_path
452 assert dict(dvc.datasets.items()) == {
453 "dogs": DatachainDataset(
454 manifest_path=path,
455 spec=DatasetSpec(name="dogs", url="dc://dogs", type="dc"),
456 ),
457 "example-get-started": DVCDataset(
458 manifest_path=path,
459 spec=DVCDatasetSpec(
460 name="example-get-started",
461 url="git@github.com:iterative/example-get-started.git",
462 path="path",
463 type="dvc",
464 ),
465 ),
466 "cloud-versioning-demo": URLDataset(
467 manifest_path=path,
468 spec=DatasetSpec(
469 name="cloud-versioning-demo",
470 url="s3://cloud-versioning-demo",
471 type="url",
472 ),
473 ),
474 }

Callers

nothing calls this directly

Calls 8

DatachainDatasetClass · 0.90
DatasetSpecClass · 0.90
DVCDatasetClass · 0.90
DVCDatasetSpecClass · 0.90
URLDatasetClass · 0.90
dictClass · 0.85
itemsMethod · 0.80
dumpMethod · 0.45

Tested by

no test coverage detected