Commit b944b4a6 authored by 张慧's avatar 张慧

商祥页-推荐商品列表接口

parent 2017c44e
import path_setting
from in_common.base_request import BaseRequest
class hybrid_promotion_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.HYBRID_PROMOTION_CONFIG)
#商祥页-sku信息
def related_service_data(self, service_id, page):
self.params["service_id"] = service_id
self.params["page"] = page
return self.api_send(self.data["related_service_data"])
if __name__ == '__main__':
#打印商祥页-推荐商品列表接口返回
print(hybrid_promotion_request().related_service_data("5815040", 1))
#商祥页-推荐商品列表
related_service_data:
method: get
url: /hybrid/promotion/related_service/_data
params:
service_id: ${service_id}
page: ${page}
data: {}
json: {}
\ No newline at end of file
...@@ -198,6 +198,9 @@ HYBRID_GET_GIFT_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", ...@@ -198,6 +198,9 @@ HYBRID_GET_GIFT_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api",
GET_GIFT_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_get_gift_data", "get_gift_data.yaml") GET_GIFT_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_get_gift_data", "get_gift_data.yaml")
#商祥页-美券列表-我的美券点击-744版本及以后-新接口 #商祥页-美券列表-我的美券点击-744版本及以后-新接口
PRODUCT_COUPON_MY_LIST = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "product_coupon_my_list.yaml") PRODUCT_COUPON_MY_LIST = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "product_coupon_my_list.yaml")
#商祥页-推荐商品列表
HYBRID_PROMOTION_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "hybrid_promotion_request.yaml")
RELATED_SERVICE_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_promotion_data", "related_service_data.yaml")
#捜索结果页-医生/医院tab #捜索结果页-医生/医院tab
CONTENTV6_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "search_request.yaml") CONTENTV6_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "search_request.yaml")
......
import pytest
from all_backend_api.hybrid_promotion_request import hybrid_promotion_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestTelatedServiceData:
data = BaseRequest().api_load(path_setting.RELATED_SERVICE_DATA)
related_service_data_case, related_service_data_data = get_ids(data, "related_service_data")
@pytest.mark.parametrize("param", related_service_data_data, ids=related_service_data_case)
def test_related_service_data(self, param):
r = hybrid_promotion_request().related_service_data(param["service_id"], param["page"])
if r["error"] == 0:
assert r["error"] == param["assert_error"]
related_service_data:
-
case: "商祥页-推荐商品列表-接口调用成功case"
service_id: "5815040"
page: 1
assert_error: 0
\ No newline at end of file
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