Commit b3c358fa authored by 张淑琴's avatar 张淑琴

消息列表

parent 37c99e71
No preview for this file type
import path_setting
from in_common.base_request import BaseRequest
class my_conversation_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.MY_CONVERSATION_CONFIG)
def my_conversation(self,current_city_id,start_num,count,):
self.params["current_city_id"] = current_city_id
self.params["start_num"] = start_num
self.params["count"] = count
return self.api_send(self.data["my_conversation"])
if __name__ == '__main__':
print(my_conversation_request().my_conversation("beijing", "0", 10))
\ No newline at end of file
my_conversation:
method: get
url: /api/my_conversation/
params:
current_city_id: ${current_city_id}
start_num: ${start_num}
count: 10
data: {}
json: {}
isLogin: 1 #需要登录的接口
\ No newline at end of file
...@@ -36,6 +36,10 @@ HOSPITAL_DOCTOR = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hospita ...@@ -36,6 +36,10 @@ HOSPITAL_DOCTOR = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hospita
HOME_V5_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "service_request.yaml") HOME_V5_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "service_request.yaml")
HOME_V5=os.path.join(BASE_DIR,"backend_auto/test_backend_data/service_data","home_v5.yaml") HOME_V5=os.path.join(BASE_DIR,"backend_auto/test_backend_data/service_data","home_v5.yaml")
MY_CONVERSATION_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "my_conversation_request.yaml")
MY_CONVERSATION = os.path.join(BASE_DIR, "backend_auto/test_backend_data/my_conversation_data", "my_conversation.yaml")
if __name__ == '__main__': if __name__ == '__main__':
print("==========",HOSTYAML_CONFIG) print("==========",HOSTYAML_CONFIG)
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.my_conversation_request import my_conversation_request
class TestMyConversation:
data = BaseRequest().api_load(path_setting.MY_CONVERSATION)
my_conversation_case, my_conversation_data = get_ids(data, "my_conversation")
@pytest.mark.parametrize("param",my_conversation_data,ids=my_conversation_case)
def test_my_conversation(self,param):
'''私信列表'''
r = my_conversation_request().my_conversation(param["current_city_id"], param["start_num"], param["count"])
if r["error"] == 0:
conversation_list = r.get("data").get("conversation_list", [])
assert len(conversation_list) <= param["assert"]
my_conversation:
#验证成功case
-
case: "请求成功,有数据返回的第一页数据"
current_city_id: "beijing"
start_num: 0
count: 10
assert: 10
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