X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/62f82658619bd59644b4bdac6b83be8fe87aca0d..bfdecdcaf7dbeabfacc0efefb864e0024dbef9ab:/sdk/python/tests/test_arv_copy.py diff --git a/sdk/python/tests/test_arv_copy.py b/sdk/python/tests/test_arv_copy.py index 452c2beba2..b853b33043 100644 --- a/sdk/python/tests/test_arv_copy.py +++ b/sdk/python/tests/test_arv_copy.py @@ -42,6 +42,8 @@ class ArvCopyVersionTestCase(run_test_server.TestCaseWithServers, tutil.VersionC with c.open('foo', 'wt') as f: f.write('foo') c.save_new("arv-copy foo collection", owner_uuid=src_proj) + coll_record = api.collections().get(uuid=c.manifest_locator()).execute() + assert coll_record['storage_classes_desired'] == ['default'] dest_proj = api.groups().create(body={"group": {"name": "arv-copy dest project", "group_class": "project"}}).execute()["uuid"] @@ -59,10 +61,13 @@ class ArvCopyVersionTestCase(run_test_server.TestCaseWithServers, tutil.VersionC contents = api.groups().list(filters=[["owner_uuid", "=", dest_proj]]).execute() assert len(contents["items"]) == 0 - try: - self.run_copy(["--project-uuid", dest_proj, src_proj]) - except SystemExit as e: - assert e.code == 0 + with tutil.redirected_streams( + stdout=tutil.StringIO, stderr=tutil.StringIO) as (out, err): + try: + self.run_copy(["--project-uuid", dest_proj, "--storage-classes", "foo", src_proj]) + except SystemExit as e: + assert e.code == 0 + copy_uuid_from_stdout = out.getvalue().strip() contents = api.groups().list(filters=[["owner_uuid", "=", dest_proj]]).execute() assert len(contents["items"]) == 1 @@ -70,12 +75,15 @@ class ArvCopyVersionTestCase(run_test_server.TestCaseWithServers, tutil.VersionC assert contents["items"][0]["name"] == "arv-copy project" copied_project = contents["items"][0]["uuid"] + assert copied_project == copy_uuid_from_stdout + contents = api.collections().list(filters=[["owner_uuid", "=", copied_project]]).execute() assert len(contents["items"]) == 1 assert contents["items"][0]["uuid"] != c.manifest_locator() assert contents["items"][0]["name"] == "arv-copy foo collection" assert contents["items"][0]["portable_data_hash"] == c.portable_data_hash() + assert contents["items"][0]["storage_classes_desired"] == ["foo"] finally: os.environ['HOME'] = home_was