Fix --submit-runner-cluster tests refs #14198
authorPeter Amstutz <pamstutz@veritasgenetics.com>
Wed, 21 Nov 2018 19:00:04 +0000 (14:00 -0500)
committerPeter Amstutz <pamstutz@veritasgenetics.com>
Wed, 21 Nov 2018 19:02:45 +0000 (14:02 -0500)
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz@veritasgenetics.com>

sdk/cwl/tests/test_submit.py

index 92ea553ea8ec4854af1f3292a11fd37829099181..1b892a9836f209857995fbf4e94002e015dcd1cf 100644 (file)
@@ -1452,6 +1452,7 @@ class TestSubmit(unittest.TestCase):
     @stubs
     def test_submit_container_cluster_id(self, stubs):
         capture_stdout = cStringIO.StringIO()
     @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",
         try:
             exited = arvados_cwl.main(
                 ["--submit", "--no-wait", "--api=containers", "--debug", "--submit-runner-cluster=zbbbb",
@@ -1469,6 +1470,17 @@ class TestSubmit(unittest.TestCase):
                          stubs.expect_container_request_uuid + '\n')
 
 
                          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"
 
 class TestCreateTemplate(unittest.TestCase):
     existing_template_uuid = "zzzzz-d1hrv-validworkfloyml"