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 63f49523f29c1330f49e5fa755b289ac8b3461e1..d77b4a215d2ce5c52429eee63d5f8fb110493d82 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 399a44436855f1649fb9160e7cca4a1fbee9e703..a2caca130f2c9ba464d9d87cc5bf8c453815e267 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 6ab197c5dd57a6e7802b8fe81eea9759ce1c4323..314950c58871dd0794a64d7a8f0f3e74222b8b48 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)