Esempio n. 1
0
def test_copy_preserve_etag_across_buckets(cloud, dvc):
    cloud.gen(FILE_WITH_CONTENTS)
    rem = _get_odb(dvc, cloud.config)
    s3 = rem.fs
    s3.fs.mkdir("another/")

    config = cloud.config.copy()
    config["url"] = "s3://another"
    config["region"] = "us-east-1"

    another = S3FileSystem(**config)

    from_info = rem.path_info / "foo"
    to_info = another.PATH_CLS("s3://another/foo")

    rem.fs.copy(from_info, to_info)

    from_hash = rem.fs.info(from_info)["etag"]
    to_hash = another.info(to_info)["etag"]

    assert from_hash == to_hash
Esempio n. 2
0
def test_copy_preserve_etag_across_buckets(cloud, dvc):
    cloud.gen(FILE_WITH_CONTENTS)
    rem = _get_odb(dvc, cloud.config)
    s3 = rem.fs.s3
    s3.create_bucket(Bucket="another")

    config = cloud.config.copy()
    config["url"] = "s3://another"
    config["region"] = "us-east-1"

    another = S3FileSystem(**config)

    from_info = rem.fs.path.join(rem.fs_path, "foo")
    to_info = "another/foo"

    rem.fs.copy(from_info, to_info)

    from_hash = rem.fs.info(from_info)["ETag"].strip('"')
    to_hash = another.info(to_info)["ETag"].strip('"')

    assert from_hash == to_hash
Esempio n. 3
0
def remote(request, dvc):
    cloud = request.param
    cloud.gen(FILE_WITH_CONTENTS)
    return _get_odb(dvc, cloud.config)