Commit e7186fe0 authored by edz's avatar edz

doctor 后台提交

parent 42c6066e
import path_setting
from in_common.base_request import BaseRequest
class web2_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.SERVICE_URL)
def service_list(self, page,pagesize,is_online):
self.params["page"] = page
self.params["pagesize"] = pagesize
self.params["is_online"] = is_online
return self.api_send(self.data["service_list"])
if __name__ == '__main__':
print(web2_request().service_list("1", "10", "-1"))
\ No newline at end of file
service_list:
method: get
url: /api/web2/service/list
params:
page: ${page}
pagesize: ${pagesize}
is_online: ${is_online}
data: {}
json: {}
\ No newline at end of file
......@@ -6,6 +6,8 @@ sys.path.append(BASE_DIR)
HOSTYAML_CONFIG = os.path.join(BASE_DIR, "backend_auto", "host.yaml")
APYAML_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "account_request.yaml")
LOGIN_VFC = os.path.join(BASE_DIR, "backend_auto/test_backend_data/account_data", "login_vfc.yaml")
SERVICE_DATA=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web2_data", "service_list.yaml")
SERVICE_URL=os.path.join(BASE_DIR, "backend_auto/all_doctor_api", "web2_request.yaml")
if __name__ == '__main__':
print("==========",HOSTYAML_CONFIG)
import pytest
import path_setting
from all_doctor_api.web2_request import web2_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
class TestServiceList:
data = BaseRequest().api_load(path_setting.SERVICE_DATA)
ServiceList_case, ServiceList_data = get_ids(data, "service_list")
@pytest.mark.parametrize("params",ServiceList_data,ids=ServiceList_case)
def test_ServiceList(self,params):
r = web2_request().service_list(params['page'],params['pagesize'],params['is_online'])
if r["error"] == 0:
assert r["data"]["page"] == params["assert"]
elif r["error"] == 1:
assert r["message"] == params["assert"]
# else:
# assert r['error'] == 0
\ No newline at end of file
service_list:
#有数据返回
-
case: "数据"
page: "1"
pagesize: "10"
is_online: "-1"
assert: "1"
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