X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/8f1185e3709f99475611c7f60122b4d2ebc67e5c..8352a6863cdcc2794108a71fd5b64e7b75f9dd20:/sdk/cwl/tests/test_submit.py?ds=inline diff --git a/sdk/cwl/tests/test_submit.py b/sdk/cwl/tests/test_submit.py index 0fd824fbe1..1b892a9836 100644 --- a/sdk/cwl/tests/test_submit.py +++ b/sdk/cwl/tests/test_submit.py @@ -1449,6 +1449,37 @@ class TestSubmit(unittest.TestCase): self.assertEqual(capture_stdout.getvalue(), stubs.expect_container_request_uuid + '\n') + @stubs + def test_submit_container_cluster_id(self, stubs): + capture_stdout = cStringIO.StringIO() + stubs.api._rootDesc["remoteHosts"]["zbbbb"] = "123" + try: + exited = arvados_cwl.main( + ["--submit", "--no-wait", "--api=containers", "--debug", "--submit-runner-cluster=zbbbb", + "tests/wf/submit_wf.cwl", "tests/submit_test_job.json"], + capture_stdout, sys.stderr, api_client=stubs.api, keep_client=stubs.keep_client) + self.assertEqual(exited, 0) + except: + logging.exception("") + + expect_container = copy.deepcopy(stubs.expect_container_spec) + + stubs.api.container_requests().create.assert_called_with( + body=JsonDiffMatcher(expect_container), cluster_id="zbbbb") + self.assertEqual(capture_stdout.getvalue(), + stubs.expect_container_request_uuid + '\n') + + + @stubs + def test_submit_validate_cluster_id(self, stubs): + capture_stdout = cStringIO.StringIO() + stubs.api._rootDesc["remoteHosts"]["zbbbb"] = "123" + exited = arvados_cwl.main( + ["--submit", "--no-wait", "--api=containers", "--debug", "--submit-runner-cluster=zcccc", + "tests/wf/submit_wf.cwl", "tests/submit_test_job.json"], + capture_stdout, sys.stderr, api_client=stubs.api, keep_client=stubs.keep_client) + self.assertEqual(exited, 1) + class TestCreateTemplate(unittest.TestCase): existing_template_uuid = "zzzzz-d1hrv-validworkfloyml"