Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: tests/test_xtm_api.py

Issue 29908581: Issue #7036 - [XTM Integration] Add support for providing workflow name (Closed)
Patch Set: Addressed comments from Patch Set 1 Created Oct. 18, 2018, 4:23 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
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
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,exp_err,exp_msg,exp_ids', [
144 (_INVALID_TOKEN, 'foo', XTMCloudException, 'Authentication failed', None),
145 (_VALID_TOKEN, 'workflow', None, None, []),
146 (_VALID_TOKEN, 'workflow1', None, None, [2222]),
147 ])
148 def test_workflow_id_extraction(intercept, token, name, exp_err,
149 exp_msg, exp_ids):
150 api = XTMCloudAPI(token)
151 if exp_msg is not None:
152 exception_test(api.get_workflows_by_name, exp_err, exp_msg, name)
153 else:
154 assert exp_ids == api.get_workflows_by_name(name)
OLDNEW
« no previous file with comments | « cms/translations/xtm/xtm_api.py ('k') | tests/test_xtm_translate.py » ('j') | tests/utils.py » ('J')

Powered by Google App Engine
This is Rietveld