Ejemplo n.º 1
0
def test_hardlink_optimization(dvc, tmp_dir, ssh_server):
    port = ssh_server.test_creds["port"]
    user = ssh_server.test_creds["username"]

    config = {
        "url": SSHMocked.get_url(user, port),
        "port": port,
        "user": user,
        "keyfile": ssh_server.test_creds["key_filename"],
    }
    tree = SSHRemoteTree(dvc, config)

    from_info = tree.path_info / "empty"
    to_info = tree.path_info / "link"

    with tree.open(from_info, "wb"):
        pass

    if os.name == "nt":
        link_path = "c:" + to_info.path.replace("/", "\\")
    else:
        link_path = to_info.path

    tree.hardlink(from_info, to_info)
    assert not System.is_hardlink(link_path)
Ejemplo n.º 2
0
def test_hardlink_optimization(dvc, tmp_dir, ssh):
    tree = SSHRemoteTree(dvc, ssh.config)

    from_info = tree.path_info / "empty"
    to_info = tree.path_info / "link"

    with tree.open(from_info, "wb"):
        pass

    if os.name == "nt":
        link_path = "c:" + to_info.path.replace("/", "\\")
    else:
        link_path = to_info.path

    tree.hardlink(from_info, to_info)
    assert not System.is_hardlink(link_path)