mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-04 23:09:44 +01:00
Replaced Path* dataclasses with PathInfo/URLInfo/CloudURLInfo, which know how parse, serialize, stringify and join themselves. They also provide useful accessors like part of an url or pathlib.Path like .parent or .name. Along the way two families of bugs where fixed and should never occur in the future: - paths not matched as strings anymore, e.g. using str.startswith() - Output.path is eliminated as ambiguous Both families might had caused undefined surprising behavior when local and remote paths clash.
23 lines
555 B
Python
23 lines
555 B
Python
from __future__ import unicode_literals
|
|
import copy
|
|
import pytest
|
|
|
|
from dvc.stage import Stage
|
|
from dvc.dependency import _get, DEP_MAP
|
|
|
|
from tests.func.test_output import TESTS as OUT_TESTS
|
|
|
|
|
|
TESTS = copy.copy(OUT_TESTS)
|
|
TESTS.append(("http://example.com/path/to/file", "http"))
|
|
TESTS.append(("https://example.com/path/to/file", "https"))
|
|
|
|
|
|
def _get_dep(dvc, path):
|
|
return _get(Stage(dvc), path, None)
|
|
|
|
|
|
@pytest.mark.parametrize("url,scheme", TESTS)
|
|
def test_scheme(dvc_repo, url, scheme):
|
|
assert type(_get_dep(dvc_repo, url)) == DEP_MAP[scheme]
|