Commit 7af4a313 authored by 张慧's avatar 张慧

医生主页案例列表接口

parent 0f958609
...@@ -16,10 +16,18 @@ class doctor_request(BaseRequest): ...@@ -16,10 +16,18 @@ class doctor_request(BaseRequest):
def detail(self): def detail(self):
return self.api_send(self.data["detail"]) return self.api_send(self.data["detail"])
#医生主页案例列表
def diary(self, doctor_id):
self.params["doctor_id"] = doctor_id
return self.api_send(self.data["diary"])
if __name__ == '__main__': if __name__ == '__main__':
#打印医生/医院主页-医生说/医院说列表接口返回 #打印医生/医院主页-医生说/医院说列表接口返回
print(doctor_request().article("9918ad7eb8f511e58f8200163e000a4a")) print(doctor_request().article("9918ad7eb8f511e58f8200163e000a4a"))
#打印医生详情接口返回 #打印医生主页详情接口返回
print(doctor_request.detail()) print(doctor_request.detail())
\ No newline at end of file
#打印医生主页案例列表接口返回
print(doctor_request.diary("5bd9f05cad51403d853ba8c881989e23"))
\ No newline at end of file
...@@ -17,4 +17,15 @@ detail: ...@@ -17,4 +17,15 @@ detail:
url: /api/doctor/5bd9f05cad51403d853ba8c881989e23/detail url: /api/doctor/5bd9f05cad51403d853ba8c881989e23/detail
params: {} params: {}
data: {} data: {}
json: {}
#医生主页案例列表
diary:
method: get
url: /api/doctor/diary
params:
doctor_id: ${doctor_id}
count: 4
page: 1
data: {}
json: {} json: {}
\ No newline at end of file
...@@ -69,6 +69,8 @@ DOCTOR_ARTICLE_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", " ...@@ -69,6 +69,8 @@ DOCTOR_ARTICLE_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "
DOCTOR_ARTICLE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/doctor_data", "article.yaml") DOCTOR_ARTICLE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/doctor_data", "article.yaml")
#医生主页详情 #医生主页详情
DOCTOR_DETAIL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/doctor_data", "detail.yaml") DOCTOR_DETAIL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/doctor_data", "detail.yaml")
#医生主页案例列表
DOCTOR_DIARY = os.path.join(BASE_DIR, "backend_auto/test_backend_data/doctor_data", "diary.yaml")
#医生/医院主页-问答列表 #医生/医院主页-问答列表
USER_ANSWER_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "user_request.yaml") USER_ANSWER_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "user_request.yaml")
USER_ANSWER = os.path.join(BASE_DIR, "backend_auto/test_backend_data/user_data", "answer.yaml") USER_ANSWER = os.path.join(BASE_DIR, "backend_auto/test_backend_data/user_data", "answer.yaml")
......
import pytest
from all_backend_api.doctor_request import doctor_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestDiary:
data = BaseRequest().api_load(path_setting.DOCTOR_DIARY)
diary_case, diary_data = get_ids(data, "diary")
@pytest.mark.parametrize("param", diary_data, ids=diary_case)
def test_diary(self, param):
r = doctor_request().diary(param["doctor_id"])
if r["error"] == 0:
assert r["error"] == param["assert_error"]
diary:
-
case: "校验接口返回成功case"
doctor_id: 5bd9f05cad51403d853ba8c881989e23
assert_error: 0
\ No newline at end of file
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