Commit 856a3c41 authored by admin's avatar admin

个人中心增加断言

parent 7c17ab53
......@@ -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):
......
import path_setting
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"])
if __name__ == '__main__':
print(user_request().personal_center())
print("fgx")
personal_center:
method: GET
url: /api/user/personal_center
params:
choose_id: 0
community_id: 0
version: 7.42.0
data: {}
json: {}
isLogin: 1
\ No newline at end of file
......@@ -36,6 +36,8 @@ HOSPITAL_DOCTOR = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hospita
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")
if __name__ == '__main__':
print("==========",HOSTYAML_CONFIG)
......@@ -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