# -*- encoding=utf8 -*-
from common.db.sql.sql_del_branch_info import delData
from common.db.sql.sql_tools import main2
from common.fileUtls import FileUtils
from air_case.public1.public1.public1 import *

__author__ = "xiaohesheng"

"""
case_tag:api,spd_core1,产品检查,idxxxx,id8888-demo,sit,on
主数据平台:产品检查
python runner_test.py tag id8888-demo debug mdm3
"""

from common.common_func import commonFuc
from air_case.mdm_login.登录外网系统.登录外网系统 import login_system
from airtest.core.api import using
import sys

# 第一种方式===========================
# hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
# actual_value=delData().check_goods_info(hos_goods_id)
# print('actual_value',actual_value)
# expected_value=commonFuc().get_business_data('b5_spd3_core_business_flow','expected_value')
# print('expected_value',expected_value)
# actual_value = actual_value.replace(" ", "")
# expected_value = expected_value.replace(" ", "")
# if actual_value==expected_value:
#     print('ok')
#     commonFuc().check_text_exist_result_text('succees', 'succees')
# else:
#     print('error')
#     commonFuc().check_text_exist_result_text('error', 'succees')
# 第一种方式===========================


# 第二种方式=================================
hos_goods_id = FileUtils().r_info8('b5_spd3_core_business_flow', '产品审核信息', 'message2')["hosGoodsId"]
actual_value1 = main2(hos_goods_id)
print(actual_value1)
# print('actual_value2',actual_value1)
actual_value2 = get_process_list2(actual_value1)
print('actual_value2', actual_value2, type(actual_value2))
prov_hos_goods_id = '7be89fe4c5ee4689a5e249d3197b9947'
expected_value2 = commonFuc().get_business_data('b5_spd3_core_business_flow', 'expected_value2', prov_hos_goods_id)
expected_value2=get_process_list2(expected_value2)
print('expected_value2', expected_value2, type(expected_value2))
actual_value2 = actual_value2.replace(" ", "")
expected_value2 = expected_value2.replace(" ", "")
print(actual_value2)
print(expected_value2)

print(actual_value2 == expected_value2)
if actual_value2 == expected_value2:
    print('ok')
    commonFuc().check_text_exist_result_text('succees', 'succees')
else:
    print('error')
    commonFuc().check_text_exist_result_text('error', 'succees')
# 第二种方式=================================