mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-05 15:28:27 +01:00
37 lines
1.0 KiB
Python
37 lines
1.0 KiB
Python
import pytest
|
|
|
|
from dvc.path_info import URLInfo, CloudURLInfo
|
|
|
|
|
|
@pytest.mark.parametrize("cls", [URLInfo, CloudURLInfo])
|
|
def test_url_info_str(cls):
|
|
u = cls("ssh://[email protected]:/test1/")
|
|
assert u.url == "ssh://[email protected]/test1/"
|
|
assert str(u) == u.url
|
|
|
|
|
|
@pytest.mark.parametrize("cls", [URLInfo, CloudURLInfo])
|
|
def test_url_info_eq(cls):
|
|
u1 = cls("ssh://[email protected]:/test1/")
|
|
u2 = cls("ssh://[email protected]/test1")
|
|
assert u1 == u2
|
|
|
|
|
|
@pytest.mark.parametrize("cls", [URLInfo, CloudURLInfo])
|
|
def test_url_info_parent(cls):
|
|
u1 = cls("ssh://[email protected]:/test1/test2")
|
|
p = u1.parent
|
|
u3 = cls("ssh://[email protected]/test1")
|
|
assert u3 == p
|
|
assert str(p) == "ssh://[email protected]/test1"
|
|
|
|
|
|
@pytest.mark.parametrize("cls", [URLInfo, CloudURLInfo])
|
|
def test_url_info_parents(cls):
|
|
u1 = cls("ssh://[email protected]:/test1/test2/test3")
|
|
assert list(u1.parents) == [
|
|
cls("ssh://[email protected]/test1/test2"),
|
|
cls("ssh://[email protected]/test1"),
|
|
cls("ssh://[email protected]/"),
|
|
]
|