示例#1
0
 def test_003_role_getDetail(self):
     # 获取角色
     role_id = fs.get_role_id(c.role_name)[0][0]
     r1 = json.loads(f.test_role_getDetail(role_id))
     a.verity(r1['data']['id'], role_id, '断言id')
     a.verity(r1['data']['orgCode'], orgCode, '断言orgCode')
     a.verity(r1['data']['name'], c.role_name, '断言name')
     a.verity(r1['data']['remark'], c.role_remark, '断言remark')
示例#2
0
 def test_001_role_addRole(self):
     # 新增角色数据
     r = json.loads(
         f.test_role_addRole('', '', c.role_name, c.role_remark, orgCode))
     role_id = fs.get_role_id(c.role_name)[0][0]
     a.verity(r['data']['id'], role_id, '断言id')
     a.verity(r['data']['name'], c.role_name, '断言name')
     a.verity(r['data']['orgCode'], orgCode, '断言orgCode')
     a.verity(r['data']['remark'], c.role_remark, '断言remark')
示例#3
0
 def test_007_role_updateRole(self):
     # 修改角色数据
     role_id = fs.get_role_id(c.role_name)[0][0]
     r5 = json.loads(
         f.test_role_updateRole(0, role_id, c.role_name, c.role_remark,
                                orgCode))
     a.verity(r5['data']['id'], role_id, '断言id')
     a.verity(r5['data']['orgCode'], orgCode, '断言orgCode')
     a.verity(r5['data']['name'], c.role_name, '断言name')
     a.verity(r5['data']['remark'], c.role_remark, '断言remark')
     a.verity(r5['data']['count'], 0, '断言count')
示例#4
0
 def test_006_role(self):
     # 新增角色数据
     r = json.loads(f.test_role_addRole('', '', c.role_name, orgCode, c.role_remark))
     role_id = fs.get_role_id(c.role_name)
     a.verity(r['data']['id'], role_id, '断言id')
     a.verity(r['data']['name'], c.role_name, '断言name')
     a.verity(r['data']['orgCode'], orgCode, '断言orgCode')
     a.verity(r['data']['remark'], c.role_remark, '断言remark')
     # 保存角色权限
     f.test_role_saveRoleMoudels(role_id, '[{"id":1,"directHave":true}]')
     # 获取角色
     r1 = json.loads(f.test_role_getDetail(role_id))
     a.verity(r1['data']['id'], role_id, '断言id')
     a.verity(r1['data']['orgCode'], orgCode, '断言orgCode')
     a.verity(r1['data']['name'], c.role_name, '断言name')
     a.verity(r1['data']['remark'], c.role_remark, '断言remark')
     # 获取角色模块
     r2 = json.loads(f.test_role_getRoleMoudels(role_id))
     a.verity(r2['data'][0]['supperParentId'], 1, '断言supperParentId')
     a.verity(r2['data'][0]['supperParentName'], "实时监控", '断言id')
     # 获取角色列表
     r3 = json.loads(f.test_role_getRoles(1, 10))
     a.verity(r3['data']['pageNum'], 1, '断言pageNum')
     a.verity(r3['data']['pageSize'], 10, '断言pageSize')
     a.verityContain(r3['data']['record'],
                     "'name': '{0}', 'remark': '{1}', 'count': 0"
                     .format(c.role_name, c.role_remark))
     # 获取角色模块树
     f.test_role_getRoleMoudelTree(role_id)
     # 修改角色数据
     r5 = json.loads(f.test_role_updateRole(0, role_id, c.role_name, orgCode, c.role_remark))
     a.verity(r5['data']['id'], role_id, '断言id')
     a.verity(r5['data']['orgCode'], orgCode, '断言orgCode')
     a.verity(r5['data']['name'], c.role_name, '断言name')
     a.verity(r5['data']['remark'], c.role_remark, '断言remark')
     a.verity(r5['data']['count'], 0, '断言count')
     # 删除角色数据
     f.test_role_deleteRole(13)
示例#5
0
 def test_008_role_deleteRole(self):
     # 删除角色数据
     role_id = fs.get_role_id(c.role_name)[0][0]
     f.test_role_deleteRole(role_id)
示例#6
0
 def test_006_role_getRoleMoudelTree(self):
     # 获取角色模块树
     role_id = fs.get_role_id(c.role_name)
     f.test_role_getRoleMoudelTree(role_id)
示例#7
0
 def test_004_role_getRoleMoudels(self):
     # 获取角色模块
     role_id = fs.get_role_id(c.role_name)
     r2 = json.loads(f.test_role_getRoleMoudels(role_id))
     a.verity(r2['data'][0]['supperParentId'], 1, '断言supperParentId')
     a.verity(r2['data'][0]['supperParentName'], "实时监控", '断言id')
示例#8
0
 def test_002_role_saveRoleMoudels(self):
     # 保存角色权限
     role_id = fs.get_role_id(c.role_name)
     f.test_role_saveRoleMoudels(role_id, '[{"id":1,"directHave":true}]')