forked from dockstore-testing/md5sum-checker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
27 lines (20 loc) · 1.08 KB
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import subprocess
import unittest
class TestMd5sumChecker(unittest.TestCase):
# For each workflow, verify that it succeeds when the input file's md5sum matches and fails when it does not
def test_cwl_success(self):
process = subprocess.call(["cwltool", "checker-workflow-wrapping-tool.cwl", "checker-input-cwl.json"])
self.assertEqual(process, 0)
def test_cwl_failure(self):
process = subprocess.call(["cwltool", "checker-workflow-wrapping-tool.cwl", "checker-fail-cwl.json"])
self.assertEqual(process, 1)
def test_wdl_success(self):
process = subprocess.call(["java", "-jar", "cromwell-42.jar", "run", "checker-workflow-wrapping-workflow.wdl",
"-i", "md5sum-wdl.json"])
self.assertEqual(process, 0)
def test_wdl_failure(self):
process = subprocess.call(["java", "-jar", "cromwell-42.jar", "run", "checker-workflow-wrapping-workflow.wdl",
"-i", "md5sum-fail-wdl.json"])
self.assertEqual(process, 1)
if __name__ == '__main__':
unittest.main()