Skip to content

Commit 2310fd7

Browse files
authored
Merge pull request #3 from bencvdb/wfInfoAdd
Unite Test classes.
2 parents 83fe525 + fde3c2a commit 2310fd7

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

test/test_client_util.py

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,22 @@ class IntegrationTest(unittest.TestCase):
1818
def setUp(self):
1919
dirname, filename = os.path.split(os.path.abspath(__file__))
2020
self.testdata_dir = dirname + 'data'
21+
self.local = {'cwl': 'file://' + os.path.join(os.getcwd() + '/testdata/md5sum.cwl'),
22+
'wdl': 'file://' + os.path.join(os.getcwd() + '/testdata/md5sum.wdl'),
23+
'py': 'file://' + os.path.join(os.getcwd() + '/test/test_integration.py'),
24+
'unsupported': 'fake.txt'}
25+
26+
self.remote = {
27+
'cwl': 'https://raw.githubusercontent.com/common-workflow-language/workflow-service/master/testdata/md5sum.cwl',
28+
'wdl': 'https://raw.githubusercontent.com/common-workflow-language/workflow-service/master/testdata/md5sum.wdl',
29+
'py': 'https://raw.githubusercontent.com/common-workflow-language/workflow-service/master/test/test_integration.py',
30+
'unsupported': 'gs://topmed_workflow_testing/topmed_aligner/small_test_files_sbg/example_human_known_snp.py',
31+
'unreachable': 'https://fake.py'}
32+
33+
self.expected = {'cwl': ('v1.0', 'CWL'),
34+
'wdl': ('draft-2', 'WDL'),
35+
'py': ('2.7', 'PY'),
36+
'pyWithPrefix': ('2.7', 'PY')}
2137

2238
def tearDown(self):
2339
unittest.TestCase.tearDown(self)
@@ -38,25 +54,6 @@ def test_expand_globs(self):
3854
glob_files = expand_globs('*')
3955
assert set(files) == glob_files, '\n' + str(set(files)) + '\n' + str(glob_files)
4056

41-
42-
class WorkflowInfoTest(unittest.TestCase):
43-
44-
local = {'cwl': 'file://' + os.path.join(os.getcwd() + '/testdata/md5sum.cwl'),
45-
'wdl': 'file://' + os.path.join(os.getcwd() + '/testdata/md5sum.wdl'),
46-
'py': 'file://' + os.path.join(os.getcwd() + '/test/test_integration.py'),
47-
'unsupported': 'fake.txt'}
48-
49-
remote = {'cwl': 'https://raw.githubusercontent.com/common-workflow-language/workflow-service/master/testdata/md5sum.cwl',
50-
'wdl': 'https://raw.githubusercontent.com/common-workflow-language/workflow-service/master/testdata/md5sum.wdl',
51-
'py': 'https://raw.githubusercontent.com/common-workflow-language/workflow-service/master/test/test_integration.py',
52-
'unsupported': 'gs://topmed_workflow_testing/topmed_aligner/small_test_files_sbg/example_human_known_snp.py', # TODO: find real external file of .py, .cwl, .wdl
53-
'unreachable': 'https://fake.py'}
54-
55-
expected = {'cwl': ('v1.0', 'CWL'),
56-
'wdl': ('draft-2', 'WDL'),
57-
'py': ('2.7', 'PY'),
58-
'pyWithPrefix': ('2.7', 'PY')}
59-
6057
def testSupportedFormatChecking(self):
6158
"""
6259
Check that non-wdl, -python, -cwl files are rejected.
@@ -97,5 +94,6 @@ def testFileLocationChecking(self):
9794
self.assertEquals(wf_info(location), self.expected[format])
9895
self.assertFalse(os.path.isfile(os.path.join(os.getcwd(), 'fetchedFromRemote.' + format)))
9996

97+
10098
if __name__ == '__main__':
10199
unittest.main() # run all tests

0 commit comments

Comments
 (0)