+workflow_content = """{
+ "$graph": [
+ {
+ "baseCommand": "echo",
+ "class": "CommandLineTool",
+ "cwlVersion": "v1.2",
+ "hints": [
+ {
+ "class": "http://arvados.org/cwl#WorkflowRunnerResources"
+ }
+ ],
+ "id": "#main",
+ "inputs": [
+ {
+ "default": {
+ "basename": "b",
+ "class": "File",
+ "location": "keep:d7514270f356df848477718d58308cc4+94/b",
+ "nameext": "",
+ "nameroot": "b",
+ "size": 0
+ },
+ "id": "#main/message",
+ "inputBinding": {
+ "position": 1
+ },
+ "type": "File"
+ }
+ ],
+ "outputs": []
+ }
+ ],
+ "cwlVersion": "v1.2"
+}"""
+
+def check_workflow_content(uuid):
+ c = arvados.collection.Collection(uuid)
+ try:
+ j = json.load(c.open("workflow.json"))
+ except IOError:
+ return False
+ # The value of "acrContainerImage" is tied to the specific version
+ # of arvados-cwl-runner so we can't just compare PDH of the whole
+ # workflow collection, it changes with every version.
+ del j["$graph"][0]["hints"][0]["acrContainerImage"]
+ print
+ return json.dumps(j, sort_keys=True, indent=4, separators=(',',': ')) == workflow_content
+