Exemplo n.º 1
0
def test_info(caplog):
    cmd = CmdVersion(parse_args(["version"]))
    cmd.run()

    assert re.search(re.compile(r"DVC version: \d+\.\d+\.\d+"), caplog.text)
    assert re.search(re.compile(r"Python version: \d\.\d\.\d"), caplog.text)
    assert re.search(re.compile(r"Platform: .*"), caplog.text)
Exemplo n.º 2
0
        root_data_path,
        dir_data_path,
        subdir_data_path,
    ]
    expected = set([entry.absolute().as_posix() for entry in entries])

    paths = set()
    for root, dirs, files in ssh.walk(root_path.absolute().as_posix()):
        for entry in dirs + files:
            paths.add(posixpath.join(root, entry))

    assert paths == expected


@pytest.mark.skipif(
    CmdVersion.get_fs_type(tempfile.gettempdir())[0]
    not in ["xfs", "apfs", "btrfs"],
    reason="Reflinks only work in specified file systems",
)
def test_reflink(repo_dir, ssh):
    ssh.reflink("foo", "link")
    assert filecmp.cmp("foo", "link")
    assert not System.is_symlink("link")
    assert not System.is_hardlink("link")


@pytest.mark.skipif(
    platform.system() == "Windows",
    reason="sftp symlink is not supported on Windows",
)
def test_symlink(repo_dir, ssh):
Exemplo n.º 3
0
def test_run_in_repo(repo_dir, dvc):
    cmd = CmdVersion(parse_args(["version"]))
    ret = cmd.run_cmd()
    assert ret == 0
Exemplo n.º 4
0
def test_run_outside_of_repo(repo_dir):
    cmd = CmdVersion(parse_args(["version"]))
    ret = cmd.run_cmd()
    assert ret == 0
Exemplo n.º 5
0
def test_run():
    cmd = CmdVersion(parse_args(["version"]))
    ret = cmd.run_cmd()
    assert ret == 0