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

Unified 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.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tests/test_xtm_api.py
diff --git a/tests/test_xtm_api.py b/tests/test_xtm_api.py
index fb1708090dcdda6bae1b12dc16b253a036caff62..2f7dd7e3dc7a642b0f5c130a81fc4fccb41bcda6 100644
--- a/tests/test_xtm_api.py
+++ b/tests/test_xtm_api.py
@@ -138,3 +138,17 @@ def test_file_upload(intercept, token, project_id, files, exp_err, exp_msg,
exception_test(api.upload_files, exp_err, exp_msg, files, project_id)
else:
assert exp_jobs == api.upload_files(files, project_id)
+
+
+@pytest.mark.parametrize('token,name,exp_err,exp_msg,exp_ids', [
+ (_INVALID_TOKEN, 'foo', XTMCloudException, 'Authentication failed', None),
+ (_VALID_TOKEN, 'workflow', None, None, []),
+ (_VALID_TOKEN, 'workflow1', None, None, [2222]),
+])
+def test_workflow_id_extraction(intercept, token, name, exp_err,
+ exp_msg, exp_ids):
+ api = XTMCloudAPI(token)
+ if exp_msg is not None:
+ exception_test(api.get_workflows_by_name, exp_err, exp_msg, name)
+ else:
+ assert exp_ids == api.get_workflows_by_name(name)
« 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