Commit 44960523 authored by zhanhuasheng's avatar zhanhuasheng

调整用例顺序

parent 94cac64a
......@@ -3,7 +3,7 @@ from Utils import yaml_handler
from Utils import req_handler
from TestData.inbox.ticketStatus_test_data import ticketStatusData
class TestLivechat:
class TestTicketStatus:
yaml_path = r'inbox\ticketStatus.yaml'
yaml_data = yaml_handler.yaml_handler.get_case(yaml_path)
......
from Utils.sql_handler import test_env_conn
from TestData.inbox.ticketStatus_test_data import ticketStatusData
all_ticket_select_sql = f'select * from `im_room` where `cate_id` = {ticketStatusData.brandId} and `status` = 1'
your_ticket_select_sql = f'select * from `im_room` where `cate_id` = {ticketStatusData.brandId} and `status` = 1 and `allocation_uid` = {ticketStatusData.userId}'
unread_ticket_select_sql = f'select * from `im_room` where `cate_id` = {ticketStatusData.brandId} and `status` = 1 and `read_status` = 1'
unassigned_ticket_select_sql = f'select * from `im_room` where `cate_id` = {ticketStatusData.brandId} and `status` = 1 and `allocation_uid` = 0'
all_ticket_select_sql = f'select * from `im_room` where `cate_id` = {ticketStatusData.brandId} and `status` = 1 and `is_ignore` = 0'
your_ticket_select_sql = f'select * from `im_room` where `cate_id` = {ticketStatusData.brandId} and `status` = 1 and `allocation_uid` = {ticketStatusData.userId} and `is_ignore` = 0'
unread_ticket_select_sql = f'select * from `im_room` where `cate_id` = {ticketStatusData.brandId} and `status` = 1 and `read_status` = 1 and `is_ignore` = 0'
unassigned_ticket_select_sql = f'select * from `im_room` where `cate_id` = {ticketStatusData.brandId} and `status` = 1 and `allocation_uid` = 0 and `is_ignore` = 0'
all_ticket_num = len(test_env_conn.select_many_value(sql=all_ticket_select_sql))
......@@ -23,7 +23,7 @@ setattr(ticketStatusData,'unassigned_ticket_num_minus',len(unassigned_ticket_num
setattr(ticketStatusData,'unassigned_ticket_id',unassigned_ticket_num[0]['room_id'])
read_ticket_select_sql = f'select * from `im_room` where `cate_id` = {ticketStatusData.brandId} and `status` = 1 and `read_status` = 2 and `room_platform` = "willdesk"'
read_ticket_select_sql = f'select * from `im_room` where `cate_id` = {ticketStatusData.brandId} and `status` = 1 and `read_status` = 2 and `room_platform` = "willdesk" and `is_ignore` = 0'
read_ticket_select_result = test_env_conn.select_one_value(sql=read_ticket_select_sql)
setattr(ticketStatusData,'read_ticket_id',read_ticket_select_result["room_id"])
......
......@@ -71,8 +71,7 @@ class ReqHandler:
data = {}
headers = {'Authorization' : getattr(global_variate.Global,'access_token'),'User-Agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36'} #如果没有请求头,默认赋予一个带token的head
if case.get('headers'):
for key,value in case['headers'].items():
headers[key] = value
headers.update(case['headers'])
if method == 'post':
if headers.get('content-type') == 'application/x-www-form-urlencoded' or headers.get('content-type') == 'text/xml':
res = requests.request(url=url,method=method,data=data,headers=headers)
......
Markdown is supported
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