mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-09 23:10:24 +01:00
Pre-requisite for removing fs.path_info and switching to regular strings as paths in filesystems. With new filesystems we no longer need the zoo of different dependency and output types, as most of them are now just handled by the underlying filesystem. Though deps/outs are still due for a refactor in other aspects.
32 lines
1011 B
Python
32 lines
1011 B
Python
import pytest
|
|
|
|
from dvc.fs import get_fs_cls
|
|
from dvc.fs.hdfs import HDFSFileSystem
|
|
from dvc.fs.http import HTTPFileSystem
|
|
from dvc.fs.https import HTTPSFileSystem
|
|
from dvc.fs.local import LocalFileSystem
|
|
from dvc.fs.s3 import S3FileSystem
|
|
from dvc.fs.ssh import SSHFileSystem
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
"url, cls",
|
|
[
|
|
("s3://bucket/path", S3FileSystem),
|
|
("ssh://example.com:/dir/path", SSHFileSystem),
|
|
("hdfs://example.com/dir/path", HDFSFileSystem),
|
|
("http://example.com/path/to/file", HTTPFileSystem),
|
|
("https://example.com/path/to/file", HTTPSFileSystem),
|
|
("path/to/file", LocalFileSystem),
|
|
("path\\to\\file", LocalFileSystem),
|
|
("file", LocalFileSystem),
|
|
("./file", LocalFileSystem),
|
|
(".\\file", LocalFileSystem),
|
|
("../file", LocalFileSystem),
|
|
("..\\file", LocalFileSystem),
|
|
("unknown://path", LocalFileSystem),
|
|
],
|
|
)
|
|
def test_get_fs_cls(url, cls):
|
|
assert get_fs_cls({"url": url}) == cls
|