LEFT | RIGHT |
1 # This file is part of the Adblock Plus web scripts, | 1 # This file is part of the Adblock Plus web scripts, |
2 # Copyright (C) 2006-present eyeo GmbH | 2 # Copyright (C) 2006-present eyeo GmbH |
3 # | 3 # |
4 # Adblock Plus is free software: you can redistribute it and/or modify | 4 # Adblock Plus is free software: you can redistribute it and/or modify |
5 # it under the terms of the GNU General Public License version 3 as | 5 # it under the terms of the GNU General Public License version 3 as |
6 # published by the Free Software Foundation. | 6 # published by the Free Software Foundation. |
7 # | 7 # |
8 # Adblock Plus is distributed in the hope that it will be useful, | 8 # Adblock Plus is distributed in the hope that it will be useful, |
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 def test_file_upload(intercept, token, project_id, files, exp_err, exp_msg, | 133 def test_file_upload(intercept, token, project_id, files, exp_err, exp_msg, |
134 exp_jobs): | 134 exp_jobs): |
135 """Test file uploading.""" | 135 """Test file uploading.""" |
136 api = XTMCloudAPI(token) | 136 api = XTMCloudAPI(token) |
137 if exp_msg is not None: | 137 if exp_msg is not None: |
138 exception_test(api.upload_files, exp_err, exp_msg, files, project_id) | 138 exception_test(api.upload_files, exp_err, exp_msg, files, project_id) |
139 else: | 139 else: |
140 assert exp_jobs == api.upload_files(files, project_id) | 140 assert exp_jobs == api.upload_files(files, project_id) |
141 | 141 |
142 | 142 |
143 @pytest.mark.parametrize('token,name,exact,exp_err,exp_msg,exp_ids', [ | 143 @pytest.mark.parametrize('token,name,exp_err,exp_msg,exp_ids', [ |
144 (_INVALID_TOKEN, 'foo', True, XTMCloudException, 'Authentication ' | 144 (_INVALID_TOKEN, 'foo', XTMCloudException, 'Authentication failed', None), |
145 'failed', None), | 145 (_VALID_TOKEN, 'workflow', None, None, []), |
146 (_VALID_TOKEN, 'workflow', True, None, None, []), | 146 (_VALID_TOKEN, 'workflow1', None, None, [2222]), |
147 (_VALID_TOKEN, 'workflow1', True, None, None, [2222]), | |
148 (_VALID_TOKEN, 'workflow', False, None, None, [2222, 3333]), | |
149 ]) | 147 ]) |
150 def test_workflow_id_extraction(intercept, token, name, exact, exp_err, | 148 def test_workflow_id_extraction(intercept, token, name, exp_err, |
151 exp_msg, exp_ids): | 149 exp_msg, exp_ids): |
152 api = XTMCloudAPI(token) | 150 api = XTMCloudAPI(token) |
153 if exp_msg is not None: | 151 if exp_msg is not None: |
154 exception_test(api.get_workflows_by_name, exp_err, exp_msg, name, | 152 exception_test(api.get_workflows_by_name, exp_err, exp_msg, name) |
155 exact) | |
156 else: | 153 else: |
157 assert exp_ids == api.get_workflows_by_name(name, exact) | 154 assert exp_ids == api.get_workflows_by_name(name) |
LEFT | RIGHT |