test_roleId.py
724 Bytes
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
if __name__ == '__main__':
unittest.main()