Commit 68ea1ed6 authored by edz's avatar edz

add 商品审核-商品查看

parent 7de260ff
password: password:
method: post method: post
url: /api/accounts/login/password url: /api/accounts/login/password
params: params:
......
...@@ -4,14 +4,23 @@ from in_common.base_request import BaseRequest ...@@ -4,14 +4,23 @@ from in_common.base_request import BaseRequest
class web2_request(BaseRequest): class web2_request(BaseRequest):
def __init__(self): def __init__(self):
self.data = self.api_load(path_setting.SERVICE_URL) self.SERVICE_URL = self.api_load(path_setting.SERVICE_URL)
# self.SERVICE_REVIEW_URL = self.api_load(path_setting.SERVICE_REVIEW_URL)
def service_list(self, page,pagesize,is_online): def service_list(self, page,pagesize,is_online):
self.params["page"] = page self.params["page"] = page
self.params["pagesize"] = pagesize self.params["pagesize"] = pagesize
self.params["is_online"] = is_online self.params["is_online"] = is_online
return self.api_send(self.SERVICE_URL["service_list"])
def service_review_list(self,page,pagesize,type):
self.params["page"] = page
self.params["pagesize"] = pagesize
self.params["type"] = type
return self.api_send(self.SERVICE_URL["service_review_list"])
return self.api_send(self.data["service_list"])
if __name__ == '__main__': if __name__ == '__main__':
print(web2_request().service_list("1", "10", "-1")) print(web2_request().service_list("1", "10", "-1"))
\ No newline at end of file # print(web2_request().service_review_list("1", "10", "0"))
\ No newline at end of file
...@@ -5,6 +5,24 @@ service_list: ...@@ -5,6 +5,24 @@ service_list:
page: ${page} page: ${page}
pagesize: ${pagesize} pagesize: ${pagesize}
is_online: ${is_online} is_online: ${is_online}
data: {} data:
phone_num: ${phone_num}
vfc_code: ${vfc_code}
face_token: ${face_token}
json: {} json: {}
isLogin: 1 isLogin: 1
\ No newline at end of file
service_review_list:
method: get
url: /api/web2/service/review/list
params:
page: ${page}
pagesize: ${pagesize}
type: ${type}
data:
phone_num: ${phone_num}
vfc_code: ${vfc_code}
face_token: ${face_token}
json: {}
isLogin: 1
\ No newline at end of file
develop_host: develop_host:
backend: http://backend.paas-develop.env # backend: http://backend.paas-develop.env
doctor: http://doctor.paas-develop.env doctor: http://doctor.paas-develop.env
...@@ -18,20 +18,18 @@ DIARY_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/account_data ...@@ -18,20 +18,18 @@ DIARY_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/account_data
KEYWORDS_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "search_request.yaml") KEYWORDS_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "search_request.yaml")
KEYWORDS = os.path.join(BASE_DIR, "backend_auto/test_backend_data/search_data", "keywords.yaml") KEYWORDS = os.path.join(BASE_DIR, "backend_auto/test_backend_data/search_data", "keywords.yaml")
#医生后台-我的商品
SERVICE_DATA=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web2_data", "service_list.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") SERVICE_URL=os.path.join(BASE_DIR, "backend_auto/all_doctor_api", "web2_request.yaml")
#医生后台-商品审核
SERVICE_REVIEW_DATA=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web2_data", "service_review_list.yaml")
#搜索首页-热门搜索 #搜索首页-热门搜索
KEYWORDS_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "search_request.yaml") KEYWORDS_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "search_request.yaml")
KEYWORDS = os.path.join(BASE_DIR, "backend_auto/test_backend_data/search_data", "keywords.yaml") KEYWORDS = os.path.join(BASE_DIR, "backend_auto/test_backend_data/search_data", "keywords.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")
# 首页灰度v9,精选tab # 首页灰度v9,精选tab
FEED_INDEXV9_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "feed_request.yaml") FEED_INDEXV9_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "feed_request.yaml")
FEED_INDEXV9_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/feed_data", "index_v9.yaml") FEED_INDEXV9_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/feed_data", "index_v9.yaml")
......
...@@ -7,17 +7,20 @@ from in_common.base_request import BaseRequest ...@@ -7,17 +7,20 @@ from in_common.base_request import BaseRequest
class TestServiceList: class TestServiceList:
data = BaseRequest().api_load(path_setting.SERVICE_DATA) service_list = BaseRequest().api_load(path_setting.SERVICE_DATA)
ServiceList_case, ServiceList_data = get_ids(data, "service_list") ServiceList_case, ServiceList_data = get_ids(service_list, "service_list")
print("-----",service_list)
@pytest.mark.parametrize("params",ServiceList_data,ids=ServiceList_case) @pytest.mark.parametrize("params",ServiceList_data,ids=ServiceList_case)
def test_ServiceList(self,params): def test_ServiceList(self,params):
r = web2_request().service_list(params['page'],params['pagesize'],params['is_online']) r = web2_request().service_list(params['page'],params['pagesize'],params['is_online'])
print("======",r)
if r["error"] == 0: if r["error"] == 0:
assert r["data"]["page"] == params["assert"] assert r["data"]["page"] == params["assert"]
elif r["error"] == 1: elif r["error"] == 1:
assert r["message"] == params["assert"] assert r["message"] == params["assert"]
# else: # else:
# assert r['error'] == 0 # assert r['error'] == 0
\ No newline at end of file
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 TestServiceReviewList:
service_review_list = BaseRequest().api_load(path_setting.SERVICE_REVIEW_DATA)
ServiceReviewList_case, ServiceReviewList_data = get_ids(service_review_list, "service_review_list")
@pytest.mark.parametrize("params", ServiceReviewList_data, ids=ServiceReviewList_case)
def test_ServiceReviewList(self, params):
r = web2_request().service_review_list(params['page'], params['pagesize'], params['type'])
if r["error"] == 0:
assert r["data"]["page"] == params["assert"]
elif r["error"] == 1:
assert r["message"] == params["assert"]
\ No newline at end of file
service_list: service_list:
#有数据返回 #有数据返回
- -
case: "数据" case: "我的商品-有数据返回"
page: "1" page: "1"
pagesize: "10" pagesize: "10"
is_online: "-1" is_online: "-1"
assert: 1 assert: 1
service_review_list:
#有数据返回
-
case: "商品审核-有数据返回"
page: "1"
pagesize: "10"
type: "0"
assert: 1
service_review_list:
#有数据返回
-
case: "商品审核-有数据返回"
page: "1"
pagesize: "10"
type: "0"
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