mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
Related to #1629 Speeds up HDFS tests significantly. E.g. ExternalHDFS test goes from 600 sec to 190sec. test_open_external[HDFS] from 160sec to 3sec. Signed-off-by: Ruslan Kuprieiev <[email protected]>
40 lines
927 B
Python
40 lines
927 B
Python
import os
|
|
import sys
|
|
|
|
import pytest
|
|
|
|
from dvc.stage import Stage
|
|
from dvc.output import _get, OUTS_MAP
|
|
|
|
|
|
TESTS = [
|
|
("s3://bucket/path", "s3"),
|
|
("gs://bucket/path", "gs"),
|
|
("ssh://example.com:/dir/path", "ssh"),
|
|
pytest.param(
|
|
"hdfs://example.com/dir/path",
|
|
"hdfs",
|
|
marks=pytest.mark.skipif(
|
|
sys.version_info[0] == 2 and os.name == "nt",
|
|
reason="Not supported for python 2 on Windows.",
|
|
),
|
|
),
|
|
("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_repo, url, scheme):
|
|
assert type(_get_out(dvc_repo, url)) == OUTS_MAP[scheme]
|