from Common.function import dict_get
from TestCases.suite import mySuitePrefixAdd

logger = LogManager('ChgUserPwd').get_logger_and_add_handlers(
    1,
    log_path=ReadConfig.log_path,
    log_filename=time.strftime("%Y-%m-%d") + '.log')
ora = MyOracle()
#取10个测试号码修改密码为108109:
sql = "select rownum No ,'' flowid , '' result_info ,t.access_num , \
    t.password Old_pwd,uop_file4.f_csb_encrypt('108109',t.subscriber_ins_id) new_pwd ,t.subscriber_ins_id \
    from  uop_file4.um_subscriber t \
    where t.access_num like '1880872%' and t.mgmt_district = '0872' \
    and t.remove_tag = '0' and rownum <=100"

paras = ora.select(sql)
logger.info('测试准备数据:{}'.format(paras))
now = time.strftime("%Y%m%d%H%M%S")
file = ReadConfig.get_data_path() + 'ApiTest_ChgUserPwd_%s.xlsx' % now
#生成xls表,方便后续写入测试结果
write_dict_xls(inputData=paras, sheetName='用户密码修改', outPutFile=file)
logger.info('写入测试数据到xls.....')

rc = ReadConfig.ReadConfig("ngboss_config.ini")
h = {
    'User-Agent':
    'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.162 Safari/537.36',
    "Connection": "keep - alive",
    "Referer": rc.get_ngboss('url')
}
示例#2
0
    log_path=ReadConfig.log_path,
    log_filename=time.strftime("%Y-%m-%d") + '.log')
ora = MyOracle()
#分别取5个主卡号码和副卡号码:
'''主卡号码'''
sql_accessNum = "select rownum No ,'' flowid , '' result_info ,t.access_num , to_char(t.subscriber_ins_id) subscriber_ins_id \
    from  uop_file4.um_subscriber t \
    where t.access_num like '1830872%' and t.mgmt_district = '0872' \
    and t.remove_tag = '0' and rownum <=5"
'''副卡号码'''
sql_ViceaccessNum = "select t.access_num VICE_ACCESS_NUM , to_char(t.subscriber_ins_id) rel_subscriber_insid \
    from  uop_file4.um_subscriber t \
    where t.access_num like '135%' and t.mgmt_district = '0872' \
    and t.remove_tag = '0' and rownum <=5"

AccessNumList = ora.select(sql_accessNum)
ViceNumList = ora.select(sql_ViceaccessNum)
paras = join_dictlists(AccessNumList, ViceNumList)
# paras = [{'NO':'1','FLOWID':'','RESULT_INFO':'','ACCESS_NUM':'13908720067','VICE_ACCESS_NUM':'13908720080'}]
logger.info('测试准备数据:{}'.format(paras))
now = time.strftime("%Y%m%d%H%M%S")
file = ReadConfig.get_data_path() + 'ApiTest_ChgMainAndShare_%s.xlsx' % now
#生成xls表,方便后续写入测试结果
write_dict_xls(inputData=paras, sheetName='主套餐共享受理', outPutFile=file)
logger.info('写入测试数据到xls.....')

rc = ReadConfig.ReadConfig("ngboss_config.ini")
h = {
    'User-Agent':
    'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.162 Safari/537.36',
    "Connection": "keep - alive",