Files
dvc/tests/test_output.py
T
Ruslan Kuprieiev 53e4e1c0a9 dvc: use local scheme as default
There is no way to detect if some path is a valid path in a general
case, since every filesystem has its own requirements and limitations.
Instead, just default to a local path and let fs handle the rest.

Fixes #1433

Signed-off-by: Ruslan Kuprieiev <[email protected]>
2018-12-14 14:47:37 +02:00

31 lines
756 B
Python

from dvc.stage import Stage
from dvc.output import _get, OUTS_MAP
from tests.basic_env import TestDvc
class TestOutScheme(TestDvc):
MAP = OUTS_MAP
TESTS = {
's3://bucket/path': 's3',
'gs://bucket/path': 'gs',
'ssh://example.com:/dir/path': 'ssh',
'hdfs://example.com/dir/path': 'hdfs',
'path/to/file': '',
'path\\to\\file': '',
'file': '',
'./file': '',
'.\\file': '',
'../file': '',
'..\\file': '',
'unknown://path': '',
}
def _get(self, path):
return _get(Stage(self.dvc), path, None, None, None)
def test(self):
for path, cls in self.TESTS.items():
self.assertIsInstance(self._get(path), self.MAP[cls])