From 449605239f492b7f396fcf30869b149536b328f7 Mon Sep 17 00:00:00 2001 From: zhanhuasheng Date: Wed, 20 Mar 2024 18:13:33 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=94=A8=E4=BE=8B=E9=A1=BA?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../account/{test_account_01.py => test_01_account.py} | 0 .../billing/{test_buyPlan_01.py => test_01_buyPlan.py} | 0 .../inbox/{test_livechat_01.py => test_01_livechat.py} | 0 ...test_ticketStatus_02.py => test_02_ticketStatus.py} | 2 +- TestFile/inbox/ticketStatus_selectStatus.py | 10 +++++----- Utils/req_handler.py | 3 +-- 6 files changed, 7 insertions(+), 8 deletions(-) rename TestCase/account/{test_account_01.py => test_01_account.py} (100%) rename TestCase/billing/{test_buyPlan_01.py => test_01_buyPlan.py} (100%) rename TestCase/inbox/{test_livechat_01.py => test_01_livechat.py} (100%) rename TestCase/inbox/{test_ticketStatus_02.py => test_02_ticketStatus.py} (94%) diff --git a/TestCase/account/test_account_01.py b/TestCase/account/test_01_account.py similarity index 100% rename from TestCase/account/test_account_01.py rename to TestCase/account/test_01_account.py diff --git a/TestCase/billing/test_buyPlan_01.py b/TestCase/billing/test_01_buyPlan.py similarity index 100% rename from TestCase/billing/test_buyPlan_01.py rename to TestCase/billing/test_01_buyPlan.py diff --git a/TestCase/inbox/test_livechat_01.py b/TestCase/inbox/test_01_livechat.py similarity index 100% rename from TestCase/inbox/test_livechat_01.py rename to TestCase/inbox/test_01_livechat.py diff --git a/TestCase/inbox/test_ticketStatus_02.py b/TestCase/inbox/test_02_ticketStatus.py similarity index 94% rename from TestCase/inbox/test_ticketStatus_02.py rename to TestCase/inbox/test_02_ticketStatus.py index 63f4952..d77b4a2 100644 --- a/TestCase/inbox/test_ticketStatus_02.py +++ b/TestCase/inbox/test_02_ticketStatus.py @@ -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) diff --git a/TestFile/inbox/ticketStatus_selectStatus.py b/TestFile/inbox/ticketStatus_selectStatus.py index 399a444..a2caca1 100644 --- a/TestFile/inbox/ticketStatus_selectStatus.py +++ b/TestFile/inbox/ticketStatus_selectStatus.py @@ -1,10 +1,10 @@ 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"]) diff --git a/Utils/req_handler.py b/Utils/req_handler.py index 6ab197c..314950c 100644 --- a/Utils/req_handler.py +++ b/Utils/req_handler.py @@ -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) -- GitLab