[ARVADOS] updated: 4d164d025cd1e8c5c719b1e0f670e6cb10a6fe5e
Git user
git at public.curoverse.com
Thu Dec 1 13:54:55 EST 2016
Summary of changes:
sdk/cwl/tests/test_container.py | 40 ++++++++--------------------------------
1 file changed, 8 insertions(+), 32 deletions(-)
via 4d164d025cd1e8c5c719b1e0f670e6cb10a6fe5e (commit)
from 87143451d4c6535576fe7232729ae9ce93a26d30 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 4d164d025cd1e8c5c719b1e0f670e6cb10a6fe5e
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Thu Dec 1 13:54:53 2016 -0500
10293: Update test_done to test more stuff and remove redundant test_done_use_existing_collection.
diff --git a/sdk/cwl/tests/test_container.py b/sdk/cwl/tests/test_container.py
index b13bcde..bb66155 100644
--- a/sdk/cwl/tests/test_container.py
+++ b/sdk/cwl/tests/test_container.py
@@ -159,39 +159,11 @@ class TestContainer(unittest.TestCase):
runner.num_retries = 0
runner.ignore_docker_for_reuse = False
- col().open.return_value = []
- api.collections().list().execute.side_effect = ({"items": []},
- {"items": [{"manifest_text": "XYZ"}]})
-
- arvjob = arvados_cwl.ArvadosContainer(runner)
- arvjob.name = "testjob"
- arvjob.builder = mock.MagicMock()
- arvjob.output_callback = mock.MagicMock()
- arvjob.collect_outputs = mock.MagicMock()
- arvjob.successCodes = [0]
- arvjob.outdir = "/var/spool/cwl"
-
- arvjob.done({
- "state": "Final",
- "log_uuid": "zzzzz-4zz18-zzzzzzzzzzzzzz1",
- "output_uuid": "zzzzz-4zz18-zzzzzzzzzzzzzz2",
- "uuid": "zzzzz-xvhdp-zzzzzzzzzzzzzzz",
- "container_uuid": "zzzzz-8i9sb-zzzzzzzzzzzzzzz"
- })
-
- self.assertFalse(api.collections().create.called)
-
- @mock.patch("arvados.collection.Collection")
- def test_done_use_existing_collection(self, col):
- api = mock.MagicMock()
-
- runner = mock.MagicMock()
- runner.api = api
- runner.project_uuid = "zzzzz-8i9sb-zzzzzzzzzzzzzzz"
- runner.num_retries = 0
+ runner.api.containers().get().execute.return_value = {"state":"Complete",
+ "output": "abc+123",
+ "exit_code": 0}
col().open.return_value = []
- api.collections().list().execute.side_effect = ({"items": [{"uuid": "zzzzz-4zz18-zzzzzzzzzzzzzz2"}]},)
arvjob = arvados_cwl.ArvadosContainer(runner)
arvjob.name = "testjob"
@@ -201,13 +173,17 @@ class TestContainer(unittest.TestCase):
arvjob.successCodes = [0]
arvjob.outdir = "/var/spool/cwl"
+ arvjob.collect_outputs.return_value = {"out": "stuff"}
+
arvjob.done({
"state": "Final",
"log_uuid": "zzzzz-4zz18-zzzzzzzzzzzzzz1",
"output_uuid": "zzzzz-4zz18-zzzzzzzzzzzzzz2",
- "log_uuid": "zzzzz-4zz18-zzzzzzzzzzzzzz2",
"uuid": "zzzzz-xvhdp-zzzzzzzzzzzzzzz",
"container_uuid": "zzzzz-8i9sb-zzzzzzzzzzzzzzz"
})
self.assertFalse(api.collections().create.called)
+
+ arvjob.collect_outputs.assert_called_with("keep:abc+123")
+ arvjob.output_callback.assert_called_with({"out": "stuff"}, "success")
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list