Commit ff3642c3 authored by admin's avatar admin

医生/医院主页-问答接口

parent 71ebfe4f
import path_setting
from in_common.base_request import BaseRequest
class user_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.USER_ANSWER_CONFIG)
#医院主页问答列表
def answer(self, user):
self.params["user"] = user
return self.api_send(self.data["answer"])
if __name__ == '__main__':
#打印医生/医院主页问答列表接口返回
print(user_request().answer("21476198"))
\ No newline at end of file
#医院主页-问答接口
answer:
method: get
url: /api/user/answer
params:
user: ${user}
count: 10
page: 1
data: {}
json: {}
\ No newline at end of file
......@@ -40,6 +40,9 @@ HOSPITAL_DIARY = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hospital
#医生/医院主页-医生/医院说列表
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")
#医生/医院主页-问答列表
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")
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.user_request import user_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestAnswer:
data = BaseRequest().api_load(path_setting.USER_ANSWER)
answer_case, answer_data = get_ids(data, "answer")
@pytest.mark.parametrize("param", answer_data, ids=answer_case)
def test_answer(self, param):
r = user_request().answer(param["user"])
if r["error"] == 0:
assert r["error"] == param["assert_error"]
answer:
-
case: "校验接口返回成功case"
user: "21476198"
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