Commit 7419f7f3 authored by 肖伟's avatar 肖伟

动态获取hostMerge branch 'common_dev' of git.wanmeizhensuo.com:dengyingying/backend_auto into develop

parents fd86ee51 2b702d05
......@@ -5,7 +5,7 @@ from in_common.base_request import BaseRequest
class service_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.HOME_V5_CONFIG)
self.data = self.api_load(path_setting.HOME_V5_CONFIG) #/all_backend_api/service_request.yaml
def home_v5(self):
......
......@@ -4,6 +4,16 @@ from in_common.base_request import BaseRequest
class user_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.PERSONAL_CENTER_CONFIG)
def personal_center(self):
print("fgx")
return self.api_send(self.data["personal_center"])
def __init__(self):
self.data = self.api_load(path_setting.USER_ANSWER_CONFIG)
......@@ -14,5 +24,11 @@ class user_request(BaseRequest):
if __name__ == '__main__':
#个人中心
print(user_request().personal_center())
print("fgx")
#打印医生/医院主页问答列表接口返回
print(user_request().answer("21476198"))
personal_center:
method: GET
url: /api/user/personal_center
params:
choose_id: 0
community_id: 0
version: 7.42.0
data: {}
json: {}
isLogin: 1
#医院主页-问答接口
answer:
method: get
......@@ -8,3 +19,4 @@ answer:
page: 1
data: {}
json: {}
......@@ -97,6 +97,8 @@ MY_CONVERSATION = os.path.join(BASE_DIR, "backend_auto/test_backend_data/my_conv
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")
PERSONAL_CENTER_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "user_request.yaml")
PERSONAL_CENTER = os.path.join(BASE_DIR, "backend_auto/test_backend_data/user_data", "personal_center.yaml")
#搜索结果页-综合/百科
CONTENTV7_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "janus_request.yaml")
......
......@@ -9,13 +9,13 @@ from all_backend_api.service_request import service_request
class TestHomeV5:
data = BaseRequest().api_load(path_setting.HOME_V5)
homev5_case, homev5_data = get_ids(data, "home_v5")
print(data)
@pytest.mark.parametrize("param",homev5_data,ids=homev5_case)
def test_home_v5(self,param):
#print(param["home_v5"])
r = service_request().home_v5()
print(r)
print("home_v6")
#if r["error"] == 0:
assert r["error"] == param["assert"]
......
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.user_request import user_request
class TestPersonalCenter:
data = BaseRequest().api_load(path_setting.PERSONAL_CENTER)
personalcenter_case, personalcenter_data = get_ids(data, "personal_center")
@pytest.mark.parametrize("param", personalcenter_data, ids=personalcenter_case)
def test_personal_center(self, param):
r = user_request().personal_center()
print('feng=', r)
if r["error"] == 0:
assert r["error"] == param["assert"]
assert r["data"]["user"]["portrait"] != param["portrait"]
home_v5:
#获取商城首页
-
case: "获取商城首页--case首页"
case: "获取商城首页index--case首页"
assert: 0
......
personal_center:
#个人中心
-
case: "获取个人中心--case首页"
assert: 0
portrait: null
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