Commit 8026f680 authored by admin's avatar admin

医院主页日记列表接口

parent 2cc9caa1
import path_setting
from in_common.base_request import BaseRequest
class hospital_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.HOSPITAL_DIARY_CONFIG)
#医院主页日记列表
def diary(self, hospital):
self.params["hospital"] = hospital
return self.api_send(self.data["diary"])
if __name__ == '__main__':
#打印医院主页日记列表接口返回
print(hospital_request().diary("bjxyjcpfbyy"))
\ No newline at end of file
#医院主页日记列表
diary:
method: get
url: /api/hospital/diary
params:
hospital: ${hospital}
count: 4
page: 1
own_page: 0
tag_id:
data: {}
json: {}
\ No newline at end of file
#详情
#医院主页详情
detail:
method: get
url: /api/hospitals/bjxyjcpfbyy/detail
......@@ -6,7 +6,7 @@ detail:
data: {}
json: {}
#医生列表
#医院主页医生列表
doctor:
method: get
url: /api/hospitals/bjxyjcpfbyy/doctors
......
#商品列表
#医院主页商品列表
services:
method: get
url: /api/hospitals_v2/bjxyjcpfbyy/services
......
......@@ -34,6 +34,10 @@ HOSPITAL_DOCTOR = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hospita
#医院主页商品列表
HOSPITAL_SERVICE_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "hospitals_v2_request.yaml")
HOSPITAL_SERVICE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hospitals_v2_data", "services.yaml")
#医院主页日记列表
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")
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.hospital_request import hospital_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.HOSPITAL_DIARY)
diary_case, diary_data = get_ids(data, "diary")
@pytest.mark.parametrize("param", diary_data, ids=diary_case)
def test_diary(self, param):
r = hospital_request().diary(param["hospital"])
if r["error"] == 0:
assert r["error"] == param["assert_error"]
diary:
-
case: "校验接口返回成功case"
hospital: "bjxyjcpfbyy"
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