X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/dac167d2d3d259de8fd70d1289dbbe65c7974d4a..b8977c89db2707dd713cd4eeb11d595717fcff75:/sdk/cwl/tests/test_make_output.py diff --git a/sdk/cwl/tests/test_make_output.py b/sdk/cwl/tests/test_make_output.py index 776f07c464..05c9ee7410 100644 --- a/sdk/cwl/tests/test_make_output.py +++ b/sdk/cwl/tests/test_make_output.py @@ -1,3 +1,7 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + import functools import json import logging @@ -27,12 +31,15 @@ class TestMakeOutput(unittest.TestCase): readermock = mock.MagicMock() reader.return_value = readermock + final_uuid = final.manifest_locator() + num_retries = runner.num_retries + cwlout = StringIO.StringIO() openmock = mock.MagicMock() final.open.return_value = openmock openmock.__enter__.return_value = cwlout - _, runner.final_output_collection = runner.make_output_collection("Test output", { + _, runner.final_output_collection = runner.make_output_collection("Test output", "tag0,tag1,tag2", { "foo": { "class": "File", "location": "keep:99999999999999999999999999999991+99/foo.txt", @@ -42,7 +49,8 @@ class TestMakeOutput(unittest.TestCase): "bar": { "class": "File", "location": "keep:99999999999999999999999999999992+99/bar.txt", - "basename": "baz.txt" + "basename": "baz.txt", + "size": 4 } }) @@ -52,12 +60,18 @@ class TestMakeOutput(unittest.TestCase): self.assertEqual("""{ "bar": { "class": "File", - "location": "baz.txt" + "location": "baz.txt", + "size": 4 }, "foo": { "class": "File", - "location": "foo.txt" + "location": "foo.txt", + "size": 3 } }""", cwlout.getvalue()) self.assertIs(final, runner.final_output_collection) + self.assertIs(final_uuid, runner.final_output_collection.manifest_locator()) + self.api.links().create.assert_has_calls([mock.call(body={"head_uuid": final_uuid, "link_class": "tag", "name": "tag0"}), mock.call().execute(num_retries=num_retries)]) + self.api.links().create.assert_has_calls([mock.call(body={"head_uuid": final_uuid, "link_class": "tag", "name": "tag1"}), mock.call().execute(num_retries=num_retries)]) + self.api.links().create.assert_has_calls([mock.call(body={"head_uuid": final_uuid, "link_class": "tag", "name": "tag2"}), mock.call().execute(num_retries=num_retries)])