Commit 754c7d16 authored by 张淑琴's avatar 张淑琴

提交代码

parents f160b71e e8662fa0
import path_setting
from in_common.base_request import BaseRequest
class filter_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.FILTER_CONFIG)
def service_home_city_v2(self, current_city_id, lat, lng):
print("fgx")
self.params["current_city_id"] = current_city_id
self.params["lat"] = lat
self.params["lng"] = lng
return self.api_send(self.data["service_home_city_v2"])
if __name__ == '__main__':
#城市筛选器
print(filter_request().service_home_city_v2("", "40.002", "116.487252"))
print("fgx")
service_home_city_v2:
method: GET
url: /api/filter/service_home_city_v2
params:
current_city_id: ${current_city_id}
lat: ${lat}
lng: ${lng}
data: {}
json: {}
......@@ -4,6 +4,9 @@ from in_common.base_request import BaseRequest
class search_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.KEYWORDS_CONFIG)
#品类聚合页面医生tab列表
self.data = self.api_load(path_setting.HOSPITAL_CONFIG)
self.data = self.api_load(path_setting.KEYWORDS_CONFIG) #keywords路径
self.data = self.api_load(path_setting.CONTENTV6_CONFIG) #content_v6路径
self.data = self.api_load(path_setting.HOT_CONFIG) # hot路径
......@@ -38,3 +41,18 @@ class search_request(BaseRequest):
def hot(self, version, device_id = '97B6764B-2135-4761-9911-701C38CBC272'):
self.params["version"] = version
return self.api_send(self.data["hot"])
# 品类聚合页面医生tab列表
def hospital(self, cp_id, tag_id, q, count, device_id):
self.params["cp_id"] = cp_id
self.params["tag_id"] = tag_id
self.params["q"] = q
self.params["count"] = count
self.params["device_id"] = device_id
return self.api_send(self.data["hospital"])
if __name__ == '__main__':
# 打印购物车-猜你喜欢列表接口返回
print(search_request().hospital(82, [], "眼部整形", 10, "869378034450718"))
......@@ -35,4 +35,17 @@ hot:
url: /api/search/hot
#列出所有定义函数时的参数
params:
version: ${version}
\ No newline at end of file
version: ${version}
#品类聚合页面医生tab列表
hospital:
method: get
url: /api/search/v2/hospital
params:
cp_id: ${cp_id}
tag_id: ${tag_id}
q: ${q}
count: ${count}
device_id: ${device_id}
data: {}
json: {}
\ No newline at end of file
......@@ -241,6 +241,14 @@ REPLY_ANSWER = os.path.join(BASE_DIR, "backend_auto/test_backend_data/question_d
#回答详情页
DETAIL_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "answer_request.yaml")
DETAIL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/answer_data", "detail.yaml")
#品类聚合页面医生tab列表
HOSPITAL_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "search_request.yaml")
HOSPITAL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/search_data", "hospital.yaml")
#城市筛选器
FILTER_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "filter_request.yaml")
FILTER = os.path.join(BASE_DIR, "backend_auto/test_backend_data/filter_data", "service_home_city_v2.yaml")
#医生后台-全部私信列表
CONVERSATION=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "conversation.yaml")
......
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.filter_request import filter_request
class TestServiceHomeCityV2:
data = BaseRequest().api_load(path_setting.FILTER)
servicehomecityv2_case, servicehomecityv2_data = get_ids(data, "service_home_city_v2")
@pytest.mark.parametrize("param", servicehomecityv2_data, ids=servicehomecityv2_case)
def test_service_home_city_v2(self, param):
r = filter_request().service_home_city_v2(param["current_city_id"], param["lat"], param["lng"])
# print('feng=', r)
if r["error"] == 0:
assert len(r["data"]["area"]) > 0
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_backend_api.search_request import search_request
class TestHospital:
data = BaseRequest().api_load(path_setting.HOSPITAL)
hospital_case, hospital_data = get_ids(data, "hospital")
@pytest.mark.parametrize("param", hospital_data, ids=hospital_case)
def test_hospital(self, param):
r = search_request().hospital(param["cp_id"], param["tag_id"], param["q"], param["count"], param["device_id"])
# print('feng=', r)
if r["error"] == 0:
assert r["data"] != param["assert"]
#城市筛选器
service_home_city_v2:
-
case: "城市筛选器接口"
current_city_id: ""
lat: "40.002"
lng: "116.487252"
assert: 0
hospital:
#品类聚合页医生tab
-
case: "品类聚合页面医生tab"
assert: null
cp_id: 82
tag_id: []
q: "眼部整形"
count: 10
device_id: 869378034450718
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