Files
dvc/tests/func/test_output.py
T
Ruslan Kuprieiev 68bebe7944 remote: hdfs: use pyarrow and connection pool
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]>
2019-07-20 01:12:17 +03:00

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]