mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
* test: clean flake8 config root clutter * test: pre-commit: add isort Compatible with black (see https://github.com/timothycrosley/isort/issues/694) * lint: reorder imports * lint: more complex imports * lint: fix deepsource * config: isort: add first party dvc * tests: restyled: add isort * temp commit to revert before merge * Revert "temp commit to revert before merge" This reverts commit 11db0fd8e95fe891597cbb9bf804480909b19e24.
29 lines
695 B
Python
29 lines
695 B
Python
import pytest
|
|
|
|
from dvc.output import OUTS_MAP, _get
|
|
from dvc.stage import Stage
|
|
|
|
TESTS = [
|
|
("s3://bucket/path", "s3"),
|
|
("gs://bucket/path", "gs"),
|
|
("ssh://example.com:/dir/path", "ssh"),
|
|
("hdfs://example.com/dir/path", "hdfs"),
|
|
("path/to/file", "local"),
|
|
("path\\to\\file", "local"),
|
|
("file", "local"),
|
|
("./file", "local"),
|
|
(".\\file", "local"),
|
|
("../file", "local"),
|
|
("..\\file", "local"),
|
|
("unknown://path", "local"),
|
|
]
|
|
|
|
|
|
def _get_out(dvc, path):
|
|
return _get(Stage(dvc), path, None, None, None, None)
|
|
|
|
|
|
@pytest.mark.parametrize("url,scheme", TESTS)
|
|
def test_scheme(dvc, url, scheme):
|
|
assert type(_get_out(dvc, url)) == OUTS_MAP[scheme]
|