Commit 71ebfe4f authored by admin's avatar admin

医生说/医院说接口

parent 8026f680
import path_setting
from in_common.base_request import BaseRequest
class doctor_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.DOCTOR_ARTICLE_CONFIG)
#医院主页日记列表
def article(self, doctor_id):
self.params["doctor_id"] = doctor_id
return self.api_send(self.data["article"])
if __name__ == '__main__':
#打印医生/医院主页-医生说/医院说列表接口返回
print(doctor_request().article("9918ad7eb8f511e58f8200163e000a4a"))
\ No newline at end of file
#医生/医院主页——医生说/医院说
article:
method: get
url: /api/doctor/article
params:
doctor_id: ${doctor_id}
count: 10
page: 1
own_page: 0
doctor_type: 0
data: {}
json: {}
\ No newline at end of file
......@@ -37,7 +37,9 @@ HOSPITAL_SERVICE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hospit
#医院主页日记列表
HOSPITAL_DIARY_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "hospital_request.yaml")
HOSPITAL_DIARY = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hospital_data", "diary.yaml")
#医生/医院主页-医生/医院说列表
DOCTOR_ARTICLE_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "doctor_request.yaml")
DOCTOR_ARTICLE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/doctor_data", "article.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")
......
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 TestArticle:
data = BaseRequest().api_load(path_setting.DOCTOR_ARTICLE)
article_case, article_data = get_ids(data, "article")
@pytest.mark.parametrize("param", article_data, ids=article_case)
def test_article(self, param):
r = doctor_request().article(param["doctor_id"])
if r["error"] == 0:
assert r["error"] == param["assert_error"]
article:
-
case: "校验接口返回成功case"
doctor_id: "9918ad7eb8f511e58f8200163e000a4a"
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