Commit d1f02f59 authored by 张慧's avatar 张慧

医生主页商品列表接口

parent 7af4a313
import path_setting
from in_common.base_request import BaseRequest
class doctor_v2_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.DOCTOR_V2_CONFIG)
#医生主页商品列表
def services(self):
return self.api_send(self.data["services"])
if __name__ == '__main__':
#打印医生主页商品列表接口返回
print(doctor_v2_request().services())
\ No newline at end of file
#医生主页商品列表
services:
method: get
url: /api/doctor_v2/5bd9f05cad51403d853ba8c881989e23/services
params:
offset: 0
show_tag_distro: 1
tag_id: all
size: 10
data: {}
json: {}
\ No newline at end of file
...@@ -71,6 +71,9 @@ DOCTOR_ARTICLE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/doctor_d ...@@ -71,6 +71,9 @@ DOCTOR_ARTICLE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/doctor_d
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") DOCTOR_DIARY = os.path.join(BASE_DIR, "backend_auto/test_backend_data/doctor_data", "diary.yaml")
#医生主页商品列表
DOCTOR_V2_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "doctor_v2_request.yaml")
DOCTOR_V2_SERVICE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/doctor_v2_data", "services.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_v2_request import doctor_v2_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestServices:
data = BaseRequest().api_load(path_setting.DOCTOR_V2_SERVICE)
services_case, services_data = get_ids(data, "services")
@pytest.mark.parametrize("param", services_data, ids=services_case)
def test_services(self, param):
r = doctor_v2_request().services()
if r["error"] == 0:
assert r["error"] == param["assert_error"]
services:
-
case: "校验接口返回成功case"
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