Commit c1b00524 authored by 张慧's avatar 张慧

商祥页-sku信息接口

parent f9df5b4e
...@@ -54,11 +54,19 @@ class janus_request(BaseRequest): ...@@ -54,11 +54,19 @@ class janus_request(BaseRequest):
self.params["version"] = version self.params["version"] = version
return self.api_send(self.data["product_detail"]) return self.api_send(self.data["product_detail"])
#商祥页-sku信息
def sku_info(self, service_id, service_item_id):
self.params["service_id"] = service_id
self.params["service_item_id"] = service_item_id
return self.api_send(self.data["sku_info"])
if __name__ == '__main__': if __name__ == '__main__':
#打印购物车-猜你喜欢列表接口返回 #打印购物车-猜你喜欢列表接口返回
print(janus_request().mine_guess_you_like()) print(janus_request().mine_guess_you_like())
#打印商祥页-详情接口返回 #打印商祥页-详情接口返回
print(janus_request().product_detail("5857263", "618788", "7.43.0")) print(janus_request().product_detail("5857263", "618788", "7.43.0"))
#打印商祥页-sku信息接口返回
print(janus_request().sku_info("5857263", "618788"))
...@@ -47,6 +47,16 @@ product_detail: ...@@ -47,6 +47,16 @@ product_detail:
data: {} data: {}
json: {} json: {}
#商祥页-sku信息
sku_info:
method: get
url: /api/janus/product/detail/sku_info
params:
service_id: ${service_id}
service_item_id: ${service_item_id}
data: {}
json: {}
......
...@@ -127,7 +127,8 @@ UNREAD = os.path.join(BASE_DIR, "backend_auto/test_backend_data/notification_dat ...@@ -127,7 +127,8 @@ UNREAD = os.path.join(BASE_DIR, "backend_auto/test_backend_data/notification_dat
#商祥页-详情 #商祥页-详情
JANUS_PRODUCT_DETAIL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "product_detail.yaml") JANUS_PRODUCT_DETAIL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "product_detail.yaml")
#商祥页-sku信息
JANUS_SKU_INFO = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "sku_info.yaml")
if __name__ == '__main__': if __name__ == '__main__':
print("==========",LIVEYAML_CONFIG) print("==========",LIVEYAML_CONFIG)
import pytest
from all_backend_api.janus_request import janus_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestSkuInfo:
data = BaseRequest().api_load(path_setting.JANUS_SKU_INFO)
sku_info_case, sku_info_data = get_ids(data, "sku_info")
@pytest.mark.parametrize("param", sku_info_data, ids=sku_info_case)
def test_sku_info(self, param):
r = janus_request().sku_info(param["service_id"], param["service_item_id"])
if r["error"] == 0:
assert r["error"] == param["assert_error"]
sku_info:
-
case: "校验接口返回成功case"
service_id: "5857263"
service_item_id: "618788"
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