Commit 01959699377f2048e0f0f84990b43b2dccea3fe8
Merge branch 'feature/liuyang' into 'master'
岗位角色列表 See merge request !12
Showing
10 changed files
with
51 additions
and
27 deletions
atdd/__pycache__/PcPost.cpython-36.pyc
No preview for this file type
tests/Staff_Management/MemberList/JobList/test_add_job.py
0 → 100644
1 | +import unittest | |
2 | +from atdd.PcPost import PcPost | |
3 | +import random | |
4 | + | |
5 | + | |
6 | +class AddJob(PcPost): | |
7 | + name = random.randint(1, 10000) | |
8 | + url = '/Contact/Apicp/Job/Add' | |
9 | + | |
10 | + def setUp(self): | |
11 | + self.do_login(self.host, self.mobile, self.psw, self.domain) | |
12 | + | |
13 | + # 正常添加岗位信息 | |
14 | + def test_addjob(self): | |
15 | + data = { | |
16 | + 'jobName': 'AddJobApi' + str(self.name) # 如何动态读取 | |
17 | + } | |
18 | + result = self.PcPost(self.url, data) | |
19 | + print('接口地址:' + self.host + self.domain + self.url) | |
20 | + jobId = result['result']['jobId'] | |
21 | + print('成功生成岗位!岗位ID:' + jobId) | |
22 | + # self.assertEqual(jobId, , msg='成功生成测试jobId') # 如何判断生成的Jobid | |
23 | + return result | |
24 | + | |
25 | + # 岗位名称超过20个汉字 | |
26 | + def test_addjob_namelen(self): | |
27 | + url = '/Contact/Apicp/Job/Add' | |
28 | + data = { | |
29 | + 'jobName': '新增岗位接口,测试岗位名称超过20个汉字' + str(self.name) | |
30 | + } | |
31 | + result = self.PcPost(self.url, data) | |
32 | + jobId = result['result']['jobId'] | |
33 | + print('成功生成岗位!岗位ID:' + jobId) | |
34 | + return result | |
35 | + | |
36 | +if __name__ == '__main__': | |
37 | + unittest.main() | ... | ... |
tests/Staff_Management/MemberList/JobList/test_delete_job.py
0 → 100644
tests/Staff_Management/MemberList/test_roleId_jobid.py renamed to tests/Staff_Management/MemberList/JobList/test_roleId_jobid.py
... | ... | @@ -30,7 +30,10 @@ class RoleId(PcPost): |
30 | 30 | resultlist = result['result']['list'] |
31 | 31 | jobIdlist = [] |
32 | 32 | for i in range(len(resultlist)): |
33 | - jobId = result['result']['list'][i][jobId].split() | |
33 | + jobId = result['result']['list'][i]['jobId'].split() | |
34 | + jobIdlist[len(jobIdlist):len(jobIdlist)] = jobId | |
35 | + print(jobIdlist) | |
36 | + return jobIdlist | |
34 | 37 | |
35 | 38 | |
36 | 39 | if __name__ == '__main__': | ... | ... |
tests/Staff_Management/MemberList/test_delete_mem.py renamed to tests/Staff_Management/MemberList/MemberList/test_delete_mem.py
tests/Staff_Management/MemberList/test_detail_mem.py renamed to tests/Staff_Management/MemberList/MemberList/test_detail_mem.py
tests/Staff_Management/MemberList/test_memlist_mem.py renamed to tests/Staff_Management/MemberList/MemberList/test_memlist_mem.py
tests/Staff_Management/MemberList/test_memuid_list.py renamed to tests/Staff_Management/MemberList/MemberList/test_memuid_list.py
tests/Staff_Management/MemberList/test_search_mem.py renamed to tests/Staff_Management/MemberList/MemberList/test_search_mem.py
tests/Staff_Management/MemberList/test_save_mem.py deleted
100644 → 0
1 | -import unittest | |
2 | -from atdd.PcPost import PcPost | |
3 | - | |
4 | - | |
5 | -class SaveMem(PcPost): | |
6 | - def setUp(self): | |
7 | - self.do_login(self.host, self.mobile, self.psw, self.domain) | |
8 | - | |
9 | - def test_add_mem(self): | |
10 | - url = '/contact/Apicp/User/Save' | |
11 | - data = { | |
12 | - 'field_name': 'api-boy', | |
13 | - 'memGender': 2, | |
14 | - 'memMobile': '13818801801', | |
15 | - 'memEmail': '13818801801@163.com', | |
16 | - 'dpName': '755DDF7E0A69039F0BA121026E5D4D00', | |
17 | - 'memJob': '755DDF0C0A6916AB3CE15C27CE2D41BB', | |
18 | - 'memRole': '755DE1790A692CB94314A8BA1FEC458A' # 管理者 | |
19 | - } | |
20 | - result = self.PcPost(url, data) | |
21 | - print(self.host + '/' + self.domain + url) | |
22 | - print(result) | |
23 | - return result | |
24 | - | |
25 | -if __name__ == '__main__': | |
26 | - unittest.main() |