X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/ce45451379c464c222791af2319f823f36a5cd21..3961f5bd4349fca6769fd4263d2f7fbe54e8bcaa:/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 b560018d38..b853b33043 100644 --- a/sdk/python/tests/test_arv_copy.py +++ b/sdk/python/tests/test_arv_copy.py @@ -61,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, "--storage-classes", "foo", 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 @@ -72,6 +75,8 @@ 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