test_roleId_jobid.py
1.15 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
import unittest
from atdd.PcPost import PcPost
class RoleId(PcPost):
def setUp(self):
self.do_login(self.host, self.mobile, self.psw, self.domain)
# 获取角色列表
def test_get_roleid(self):
url = '/Contact/Apicp/Role/List'
data = {
}
result = self.PcPost(url, data)
print('接口地址: ' + self.host + self.domain + url)
list = result['result']['list']
roleidlist = []
for i in range(len(list)):
roleId = result['result']['list'][i]['roleId'].split()
roleidlist[len(roleidlist):len(roleidlist)] = roleId
print(roleidlist)
return roleidlist
# 获取岗位列表
def test_get_jobid(self):
url = '/Contact/Apicp/Job/List'
data = {
}
result = self.PcPost(url, data)
resultlist = result['result']['list']
jobIdlist = []
for i in range(len(resultlist)):
jobId = result['result']['list'][i]['jobId'].split()
jobIdlist[len(jobIdlist):len(jobIdlist)] = jobId
print(jobIdlist)
return jobIdlist
if __name__ == '__main__':
unittest.main()