# -*- encoding=utf8 -*-
__author__ = "liguangyu"

"""
case_tag:api,cmdc站点满足快速下单,用例集id2250,sit,bs
主数据平台:多彩商城快速下单权限判定接口 
"""

from common.common_func import commonFuc
import requests
import json

module = "cmdc-qos"

url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "url")
print(url)
# url = "https://service-slb.cmic.com.cn/cms/public/isQuickOrderSign"
# 获取公司ID
companyId = commonFuc().get_business_data(module, "companyId1")
print(companyId)
request_body = commonFuc().get_business_data(module, "payload", companyId)
print(request_body)
"""
 场景:站点拥有快速下单权限入口
 用例名称：快速下单权限判定接口-站点满足条件显示快速下单入口
 输入：companyId
 输出："quickOrderSign": 1
"""
# 发送请求
result = requests.get(url, params=request_body)
result = json.loads(result.text)
print(result)
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict1")
print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
