Пример #1
0
def test_cp(clean, fs_kind1, fs_kind2):
    print("test_cp", fs_kind1, fs_kind2)
    if skip_gcs[fs_kind1] or skip_gcs[fs_kind2]:
        print("skipped")
        return
    if fs_kind1 != "local":
        init(fs_kind1)
    elif fs_kind2 != "local":
        init(fs_kind2)

    path1 = TransparentPath("chien.txt", fs_kind=fs_kind1)
    path2 = TransparentPath("chien2.txt", fs_kind=fs_kind2)
    path1.touch()
    path1.cp(path2)
    assert path1.is_file()
    assert path2.is_file()
Пример #2
0
def get_path(fs_kind, suffix):
    reload(sys.modules["transparentpath"])
    if skip_gcs[fs_kind]:
        print("skipped")
        return "skipped"
    init(fs_kind)

    if fs_kind == "local":
        local_path = TransparentPath(f"tests/data/chien{suffix}")
        pfile = TransparentPath(f"chien{suffix}")
        local_path.cp(pfile)
    else:
        local_path = TransparentPath(f"tests/data/chien{suffix}",
                                     fs_kind="local")
        pfile = TransparentPath(f"chien{suffix}")
        local_path.put(pfile)

    return pfile
Пример #3
0
def get_path(fs_kind, use_pandas, simple):
    reload(sys.modules["transparentpath"])
    if skip_gcs[fs_kind]:
        print("skipped")
        return
    init(fs_kind)

    to_add = ""
    if use_pandas:
        to_add = "_pandas"
    if not simple:
        to_add = f"{to_add}_multi"

    if fs_kind == "local":
        local_path = TransparentPath(f"tests/data/chien{to_add}.hdf5")
        phdf5 = TransparentPath(f"chien.hdf5")
        local_path.cp(phdf5)
    else:
        local_path = TransparentPath(f"tests/data/chien{to_add}.hdf5",
                                     fs_kind="local")
        phdf5 = TransparentPath(f"chien.hdf5")
        local_path.put(phdf5)
    assert phdf5.is_file()
    return phdf5