-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathAccountProjectsTestData.py
More file actions
93 lines (81 loc) · 2.46 KB
/
Copy pathAccountProjectsTestData.py
File metadata and controls
93 lines (81 loc) · 2.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/usr/bin/python
# -*- coding: utf-8 -*-
""" Copyright 2012-2025 Smartling, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this work except in compliance with the License.
* You may obtain a copy of the License in the LICENSE file, or at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limit
"""
from builder.Parameters import Code
from builder.ExampleData import TestData
testsOrder = [
"getProjectsByAccount",
"getProjectDetails",
"addLocaleToProject",
"copyProject",
"getProjectCopyRequestStatus",
]
extraInitializations = '''
'''
testEnvironment = 'stg'
testDecorators = {
'getProjectsByAccount':TestData(
{
},
customTestCheck='''
assert_equal(True, res.data.totalCount > 0)
project_name = ''
for p in res.data.items:
if p['projectId'] == self.MY_PROJECT_ID:
project_name = p['projectName']
assert_equal('test variants', project_name)
'''
),
'getProjectDetails':TestData(
{
},
customTestCheck='''
assert_equal(res.data.projectId, self.MY_PROJECT_ID)
assert_equal(res.data.projectName, 'test variants')
assert_equal(res.data.accountUid, self.MY_ACCOUNT_UID)
'''
),
'addLocaleToProject':TestData(
{
'defaultWorkflowUid': '748398939979',
'localeId':'es-MX',
},
customTestCheck='''
assert_equal(res.data.projectId, self.MY_PROJECT_ID)
assert_equal(res.data.projectName, 'test variants')
assert_equal(res.data.accountUid, self.MY_ACCOUNT_UID)
locales = [l['localeId'] for l in res.data.targetLocales]
assert_equal(True, 'es-MX' in locales)
''' ),
'copyProject':TestData(
{
'projectName': 'python SDK test',
'targetLocaleIds':['es-MX', 'zh-TW'],
},
[],
['self.copy_process_uid = res.data.processUid'],
customTestCheck='''
assert_equal(res.code, 'ACCEPTED')
'''),
'getProjectCopyRequestStatus':TestData(
{
'processUid': Code('self.copy_process_uid'),
},
customTestCheck='''
assert_equal(res.data.processUid, self.copy_process_uid)
assert_equal(True, res.data.processState in ['IN_PROGRESS','COMPLETED'])
'''),
}