def setup(self): myapi.customer_add('华山医院订单002', '15951813663', '南京市鼓楼区') addcid = myapi.customer_list().json()["retlist"][0]["id"] myapi.medicines_add("青霉素", "青霉素 国字号", "234324234234") addmid = myapi.medicines_list().json()["retlist"][0]["id"] myapi.orders_add("华山医院订单002", addcid, [{ "id": addmid, "amount": 3, "name": "青霉素" }])
def teststeps(self): STEP(1, '添加用户') r = myapi.customer_add("wxl", "133456799345", "nanjingyoudian") CHECK_POINT('ret的值', r.json()["ret"] == 0) STEP(2, '检查操作') res = myapi.customer_list().json() CHECK_POINT('响应消息体内容ret', res["ret"] == 0) CHECK_POINT('响应消息体内容total', res["total"] == 2)
def teststeps(self): STEP(1, '添加用户') r = myapi.customer_add('wxl', "13345679934") STEP(2, '检查操作') CHECK_POINT('返回消息体内容', r.json() == { "ret": 1, "msg": "请求消息参数错误", })
def suite_setup(): myapi.login() myapi.orders_del_all() myapi.customer_del_all() myapi.medicines_del_all() myapi.customer_add('wxl', '15563523563', '南京鼓楼区邮电大学') myapi.customer_add('wxl1', '15563523564', '南京鼓楼区邮电大学1') myapi.customer_add('wxl2', '15563523565', '南京鼓楼区邮电大学2')
def teststeps(self): STEP(1, '添加用户') r = myapi.customer_add("武汉市桥西医院", "13345679934", "武汉市桥西医院北路") self.addid = r.json()['id'] CHECK_POINT('ret的值', r.json()["ret"] == 0) STEP(2, '检查操作') res = myapi.customer_list().json() expected = { "ret": 0, "retlist": [{ "address": "武汉市桥西医院北路", "id": self.addid, "name": "武汉市桥西医院", "phonenumber": "13345679934" }], 'total': 1 } CHECK_POINT('返回消息体内容', expected == res)
def suite_setup(): myapi.login() myapi.orders_del_all() myapi.customer_del_all() myapi.medicines_del_all() myapi.customer_add('wxl', '123456789', 'nanjingtoudiandaxue')
def suite_setup(): myapi.login() myapi.orders_del_all() myapi.customer_del_all() myapi.medicines_del_all() myapi.customer_add("武汉市桥西医院", "13345679934", "武汉市桥西医院北路")
def teststeps(self): STEP(1, '添加用户') r = myapi.customer_add("武汉市桥西医院", "13345679934", "武汉市桥西医院北路") STEP(2, '检查操作') CHECK_POINT('消息体内容', r.json() == {"ret": 1, "msg": "客户名已经存在"})