Commit d4dd7535 authored by liguangyu06's avatar liguangyu06
Browse files

优化

parent d0f7e89a
......@@ -8,6 +8,7 @@ case_tag:cmdc_api,cmdc商品限购规则批量导入,2293,2293-014,sit,bs
from common.common_func import commonFuc
from air_case.cmdc_login.后台管理系统登录.后台管理系统登录 import CmdcDoLogin
from common.handle_excel import HandleExcel
import requests
import json
import os
......@@ -27,6 +28,19 @@ headers = commonFuc().get_business_data(module, "json_headers_file", cmdc_access
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
file_path = BASE_DIR + "/data/cmdc_files/商品限购模板.xlsx"
# 设定商品信息
product_code = "12364265"
product_name = "医用检查手套"
cus_code = "1071246"
cus_name = "上海勘泽贸易商行"
# 将商品信息写入文件中
excel = HandleExcel(file_path, "Sheet1")
excel.write_data(row=2, column=1, value=product_code)
excel.write_data(row=2, column=2, value=product_name)
excel.write_data(row=2, column=3, value=cus_code)
excel.write_data(row=2, column=4, value=cus_name)
# 第二步商品限购规则批量导入操作
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url46")
......
......@@ -43,7 +43,7 @@ request_body = commonFuc().get_business_data(module, "payload47", id)
# 发送请求
result = requests.get(url, params=request_body, headers=headers)
result = json.loads(result.content)
print(result)
# print(result)
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict47")
# print(check_dict)
......
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