Commit a4dd07f7 authored by liguangyu06's avatar liguangyu06
Browse files

优化

parent 2ebef4d4
...@@ -55,7 +55,6 @@ host, port, user, pwd = mysql_handle.getConf(db="cmdc_db") ...@@ -55,7 +55,6 @@ host, port, user, pwd = mysql_handle.getConf(db="cmdc_db")
sql = "SELECT t.status FROM `cmdc-order`.tc_fresenius_group t WHERE groupId = {}".format(group_id) sql = "SELECT t.status FROM `cmdc-order`.tc_fresenius_group t WHERE groupId = {}".format(group_id)
result = {"status": mysql_handle.selectSql(host, port, user, pwd, "cmdc-order", sql)[0][0]} result = {"status": mysql_handle.selectSql(host, port, user, pwd, "cmdc-order", sql)[0][0]}
# 获取
# 获取预期结果 # 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict7") check_dict = commonFuc().get_business_data(module, "checkDict7")
# 断言实际结果中是否包含预期结果的内容 # 断言实际结果中是否包含预期结果的内容
......
...@@ -84,20 +84,26 @@ request_body = {"manufacturerGroupName": "", "manufacturerGroupCode": "", "group ...@@ -84,20 +84,26 @@ request_body = {"manufacturerGroupName": "", "manufacturerGroupCode": "", "group
# 发送请求 # 发送请求
result = requests.post(url, json=request_body, headers=headers) result = requests.post(url, json=request_body, headers=headers)
result = json.loads(result.content) result = json.loads(result.content)
print(result) # print(result)
# 数据库操作 if result["success"]:
mysql_handle = mySql() # 数据库操作
# 获取conf.ini文件中配置的数据库信息 mysql_handle = mySql()
host, port, user, pwd = mysql_handle.getConf(db="cmdc_db") # 获取conf.ini文件中配置的数据库信息
host, port, user, pwd = mysql_handle.getConf(db="cmdc_db")
# 数据库查询新增特价单品
sql = "SELECT t.groupId FROM `cmdc-order`.tc_fresenius_agreement_price t " \ # 数据库查询新增特价单品
"WHERE customerCode = {} and documentNo = '{}';".format(customer_code, ref_random) sql = "SELECT t.groupId FROM `cmdc-order`.tc_fresenius_agreement_price t " \
print(sql) "WHERE customerCode = {} and documentNo = '{}';".format(customer_code, ref_random)
total = len(mysql_handle.selectSql(host, port, user, pwd, "cmdc-order", sql)) print(sql)
result = {"total": total} total = len(mysql_handle.selectSql(host, port, user, pwd, "cmdc-order", sql))
result = {"total": total}
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict17") # 获取预期结果
# 断言实际结果中是否包含预期结果的内容 check_dict = commonFuc().get_business_data(module, "checkDict17")
commonFuc().check_result(check_dict, result) # 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
else:
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict17_1")
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
\ No newline at end of file
...@@ -148,6 +148,8 @@ checkDict16: {"customerCode":"%s"} ...@@ -148,6 +148,8 @@ checkDict16: {"customerCode":"%s"}
"url17": "/order/public/saveSingleProductPrice" "url17": "/order/public/saveSingleProductPrice"
#预期结果 #预期结果
checkDict17: {"total": 1} checkDict17: {"total": 1}
# 添加冲突
checkDict17_1: {"success":False,"code":"fresenius_agreement_price","message":"与已有同商品同客户数据效期冲突"}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment