mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-05 15:28:27 +01:00
There is a lot of duplication in current Output/Dependency classes, that was left "just in case" while developing different schemes. Since our code base is now getting more and more stable and we now know what we need to add support for any new dep/out type in the future, we can now safely unify most of the code. Signed-off-by: Ruslan Kuprieiev <[email protected]>
31 lines
796 B
Python
31 lines
796 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': 'local',
|
|
'path\\to\\file': 'local',
|
|
'file': 'local',
|
|
'./file': 'local',
|
|
'.\\file': 'local',
|
|
'../file': 'local',
|
|
'..\\file': 'local',
|
|
'unknown://path': 'local',
|
|
}
|
|
|
|
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])
|