Files
dvc/tests/unit/command/test_ls_url.py
T
Ronan Lamy fa7619dfee ls-url: create basic version of dvc ls-url command
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.
2022-10-04 14:37:29 +03:00

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")