10448: Tests include enable_reuse flag and that --disable-reuse is passed to
[arvados.git] / sdk / cwl / tests / mock_discovery.py
diff --git a/sdk/cwl/tests/mock_discovery.py b/sdk/cwl/tests/mock_discovery.py
new file mode 100644 (file)
index 0000000..f31ff22
--- /dev/null
@@ -0,0 +1,13 @@
+import json
+import arvados
+
+_rootDesc = None
+
+def get_rootDesc():
+    global _rootDesc
+    if not _rootDesc:
+        try:
+            _rootDesc = arvados.api('v1')._rootDesc
+        except ValueError:
+            raise Exception("Test requires an running API server to fetch discovery document")
+    return _rootDesc