@@ -28,7 +28,7 @@ def setUpClass(cls):
28
28
cls .wdl_json_input = "file://" + os .path .abspath ('testdata/md5sum.wdl.json' )
29
29
cls .wdl_attachments = ['file://' + os .path .abspath ('testdata/md5sum.input' )]
30
30
31
- # houses the API methods
31
+ # client for the swagger API methods
32
32
cls .client = WESClient ({'auth' : '' , 'proto' : 'http' , 'host' : 'localhost:8080' })
33
33
34
34
# manual test (wdl only working locally atm)
@@ -76,6 +76,39 @@ def test_run_attachments(self):
76
76
attachment_tool_path = get_response ["workflow_attachment" ][7 :] + "/dockstore-tool-md5sum.cwl"
77
77
self .assertTrue (check_for_file (attachment_tool_path ), 'Attachment file was not found: ' + get_response ["workflow_attachment" ])
78
78
79
+ def test_get_service_info (self ):
80
+ """
81
+ Test wes_client.util.WESClient.get_service_info()
82
+
83
+ This method will exit(1) if the response is not 200.
84
+ """
85
+ r = self .client .get_service_info ()
86
+ assert 'workflow_type_versions' in r
87
+ assert 'supported_wes_versions' in r
88
+ assert 'supported_filesystem_protocols' in r
89
+ assert 'engine_versions' in r
90
+
91
+ def test_list_runs (self ):
92
+ """
93
+ Test wes_client.util.WESClient.list_runs()
94
+
95
+ This method will exit(1) if the response is not 200.
96
+ """
97
+ r = self .client .list_runs ()
98
+ assert 'workflows' in r
99
+
100
+ def test_get_run_status (self ):
101
+ """
102
+ Test wes_client.util.WESClient.run_status()
103
+
104
+ This method will exit(1) if the response is not 200.
105
+ """
106
+ outfile_path , run_id = self .run_md5sum (wf_input = self .cwl_local_path ,
107
+ json_input = self .cwl_json_input ,
108
+ workflow_attachment = self .cwl_attachments )
109
+ r = self .client .get_run_status (run_id )
110
+ assert 'state' in r
111
+ assert 'run_id' in r
79
112
80
113
def run_md5sum (self , wf_input , json_input , workflow_attachment = None ):
81
114
"""Pass a local md5sum cwl to the wes-service server, and return the path of the output file that was created."""
@@ -136,14 +169,15 @@ def test_local_wdl(self):
136
169
"""LOCAL md5sum wdl to the wes-service server, and check for the correct output."""
137
170
# Working locally but not on travis... >.<;
138
171
if self .manual :
139
- outfile_path , run_id = run_md5sum (wf_input = self .wdl_local_path ,
140
- json_input = self .wdl_json_input ,
141
- workflow_attachment = self .wdl_attachments )
172
+ outfile_path , run_id = self . run_md5sum (wf_input = self .wdl_local_path ,
173
+ json_input = self .wdl_json_input ,
174
+ workflow_attachment = self .wdl_attachments )
142
175
self .assertTrue (check_for_file (outfile_path ), 'Output file was not found: ' + str (outfile_path ))
143
176
144
177
145
178
# Prevent pytest/unittest's discovery from attempting to discover the base test class.
146
179
del IntegrationTest
147
180
181
+
148
182
if __name__ == '__main__' :
149
183
unittest .main () # run all tests
0 commit comments