mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-08 07:18:27 +01:00
For now, this only takes a URL (or local path) and lists its contents if the protocol supports it. The command fails if the target doesn't exist and returns the (absolute) path to the target if it's not a directory.
15 lines
345 B
Python
15 lines
345 B
Python
from dvc.cli import parse_args
|
|
from dvc.commands.ls_url import CmdListUrl
|
|
|
|
|
|
def test_ls_url(mocker):
|
|
cli_args = parse_args(["ls-url", "src"])
|
|
assert cli_args.func == CmdListUrl
|
|
|
|
cmd = cli_args.func(cli_args)
|
|
m = mocker.patch("dvc.repo.Repo.ls_url", autospec=True)
|
|
|
|
assert cmd.run() == 0
|
|
|
|
m.assert_called_once_with("src")
|