def teststeps(self): STEP(1, '先列出老师') r = steacher.teacher_list() listret = r.json() teacherlist = listret["retlist"] STEP(2, '添加一个老师') n_data = [{"id": GSTORE['g_classid']}] n_classid = json.dumps(n_data) r = steacher.add_teacher('hwd', '汉武帝', 1, n_classid, '13600000000', '*****@*****.**', '3209251983090987899') addtret = r.json() self.addteacherid = addtret['id'] addretcode = r.json() STEP(3, '验证参数返回值') CHECK_POINT('返回的retcode值=0', addretcode['retcode'] == 0) STEP(4, '检查系统数据') r = steacher.teacher_list() listrest = r.json() expected = { "retlist": teacherlist + [{ "username": "******", "teachclasslist": [GSTORE['g_classid']], "realname": "汉武帝", "id": addtret['id'], "phonenumber": "13600000000", "email": "*****@*****.**", "idcardnumber": "3209251983090987899" }], "retcode": 0 } INFO(expected) CHECK_POINT('返回的消息体数据正确', expected == listrest)
def teststeps(self): STEP(1, '先列出老师') r = steacher.teacher_list() listret = r.json() teacherlist = listret["retlist"] STEP(2, '删除不存在的老师') r = steacher.del_teacher(0) addret = r.json() STEP(3, '验证参数返回值') CHECK_POINT('返回的retcode值=404', addret['retcode'] == 404) STEP(4, '检查系统数据') r = steacher.teacher_list() listrest = r.json() expected = {"retlist": teacherlist, "retcode": 0} CHECK_POINT('返回的消息体数据正确', expected == listrest)
def teststeps(self): STEP(1, '先列出老师') r = steacher.teacher_list() listret = r.json() teacherlist = listret["retlist"] STEP(2, '修改不存在老师') data = [{"id": GSTORE['g_classid']}] classid = json.dumps(data) r = steacher.modify_teacher('0', '秦始皇', 1, classid, '13600000000', '*****@*****.**', '3209251983090987899') addret = r.json() STEP(3, '验证参数返回值') CHECK_POINT('返回的retcode值=1', addret['retcode'] == 1) STEP(4, '检查系统数据') r = steacher.teacher_list() listrest = r.json() expected = {"retlist": teacherlist, "retcode": 0} CHECK_POINT('返回的消息体数据正确', expected == listrest)
def teststeps(self): STEP(1, '先列出老师') r = steacher.teacher_list() listret = r.json() teacherlist = listret["retlist"] STEP(2, '添加一个老师') data = [{"id": GSTORE['g_classid']}] classid = json.dumps(data) r = steacher.add_teacher('hwd', '汉武帝', 1, classid, '13600000000', '*****@*****.**', '3209251983090987899') addret = r.json() STEP(3, '删除老师') r = steacher.del_teacher(addret['id']) delret = r.json() STEP(3, '验证参数返回值') CHECK_POINT('返回的retcode值=0', delret['retcode'] == 0) STEP(4, '检查系统数据') r = steacher.teacher_list() listrest = r.json() expected = {"retlist": teacherlist, "retcode": 0} CHECK_POINT('返回的消息体数据正确', expected == listrest)