Update copy_deps test, refs #19688
[arvados.git] / sdk / cwl / tests / test_copy_deps.py
index 853a7d360953df486df7d13cde5db04b978f1f07..230430d86c6912e3e39188adcec8f97c13beec5c 100644 (file)
@@ -9,8 +9,8 @@ api = arvados.api()
 
 def check_contents(group, wf_uuid):
     contents = api.groups().contents(uuid=group["uuid"]).execute()
-    if len(contents["items"]) != 3:
-        raise Exception("Expected 3 items in "+group["uuid"]+" was "+len(contents["items"]))
+    if len(contents["items"]) != 4:
+        raise Exception("Expected 4 items in "+group["uuid"]+" was "+str(len(contents["items"])))
 
     found = False
     for c in contents["items"]:
@@ -33,6 +33,13 @@ def check_contents(group, wf_uuid):
     if not found:
         raise Exception("Couldn't find jobs image dependency")
 
+    found = False
+    for c in contents["items"]:
+        if c["kind"] == "arvados#collection" and c["portable_data_hash"] == "13d3901489516f9986c9685867043d39+61":
+            found = True
+    if not found:
+        raise Exception("Couldn't find collection containing workflow")
+
 
 def test_create():
     group = api.groups().create(body={"group": {"name": "test-19070-project-1", "group_class": "project"}}, ensure_unique_name=True).execute()
@@ -65,8 +72,8 @@ def test_update():
         wf_uuid = wf_uuid.decode("utf-8").strip()
 
         contents = api.groups().contents(uuid=group["uuid"]).execute()
-        if len(contents["items"]) != 1:
-            raise Exception("Expected 1 items")
+        if len(contents["items"]) != 2:
+            raise Exception("Expected 2 items")
 
         found = False
         for c in contents["items"]:
@@ -75,6 +82,13 @@ def test_update():
         if not found:
             raise Exception("Couldn't find workflow")
 
+        found = False
+        for c in contents["items"]:
+            if c["kind"] == "arvados#collection" and c["portable_data_hash"] == "13d3901489516f9986c9685867043d39+61":
+                found = True
+        if not found:
+            raise Exception("Couldn't find collection containing workflow")
+
         # Updating by default will copy missing items
         cmd = ["arvados-cwl-runner", "--update-workflow", wf_uuid, "19070-copy-deps.cwl"]
         print(" ".join(cmd))