OLD | NEW |
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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 (_VALID_TOKEN, 1234, _FILES_UPLOAD, None, None, _EXPECTED_JOBS), | 131 (_VALID_TOKEN, 1234, _FILES_UPLOAD, None, None, _EXPECTED_JOBS), |
132 ]) | 132 ]) |
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 |
| 142 |
| 143 @pytest.mark.parametrize('token,name,exact,exp_err,exp_msg,exp_ids', [ |
| 144 (_INVALID_TOKEN, 'foo', True, XTMCloudException, 'Authentication ' |
| 145 'failed', None), |
| 146 (_VALID_TOKEN, 'workflow', True, None, None, []), |
| 147 (_VALID_TOKEN, 'workflow1', True, None, None, [2222]), |
| 148 (_VALID_TOKEN, 'workflow', False, None, None, [2222, 3333]), |
| 149 ]) |
| 150 def test_workflow_id_extraction(intercept, token, name, exact, exp_err, |
| 151 exp_msg, exp_ids): |
| 152 api = XTMCloudAPI(token) |
| 153 if exp_msg is not None: |
| 154 exception_test(api.get_workflows_by_name, exp_err, exp_msg, name, |
| 155 exact) |
| 156 else: |
| 157 assert exp_ids == api.get_workflows_by_name(name, exact) |
OLD | NEW |