Commit d4da7430 authored by 张慧's avatar 张慧

商祥页-分享接口

parent 8b57e135
import path_setting
from in_common.base_request import BaseRequest
class services_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.SERVICES_CONFIG)
#商祥页-分享
def share_data(self, p_id, u_id):
self.params["p_id"] = p_id
self.params["u_id"] = u_id
return self.api_send(self.data["share_data"])
if __name__ == '__main__':
#打印商祥页-分享接口返回
print(services_request().share_data("5857263", "618788"))
\ No newline at end of file
#商祥页-分享
share_data:
method: get
url: /api/services/share_data
params:
p_id: ${p_id}
u_id: ${u_id}
data: {}
json: {}
\ No newline at end of file
...@@ -131,6 +131,9 @@ JANUS_PRODUCT_DETAIL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/ja ...@@ -131,6 +131,9 @@ JANUS_PRODUCT_DETAIL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/ja
JANUS_SKU_INFO = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "sku_info.yaml") JANUS_SKU_INFO = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "sku_info.yaml")
#商祥页-收藏 #商祥页-收藏
SERVICE_FAVOR = os.path.join(BASE_DIR, "backend_auto/test_backend_data/service_data", "service_favor.yaml") SERVICE_FAVOR = os.path.join(BASE_DIR, "backend_auto/test_backend_data/service_data", "service_favor.yaml")
#商祥页-分享
SERVICES_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "services_request.yaml")
SERVICES_SHARE_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/services_data", "share_data.yaml")
if __name__ == '__main__': if __name__ == '__main__':
print("==========",LIVEYAML_CONFIG) print("==========",LIVEYAML_CONFIG)
import pytest
from all_backend_api.services_request import services_request
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
class TestShareData:
data = BaseRequest().api_load(path_setting.SERVICES_SHARE_DATA)
share_data_case, share_data_data = get_ids(data, "share_data")
@pytest.mark.parametrize("param", share_data_data, ids=share_data_case)
def test_share_data(self, param):
r = services_request().share_data(param["p_id"], param["u_id"])
if r["error"] == 0:
assert r["error"] == param["assert_error"]
# print(services_request().share_data())
share_data:
-
case: "校验接口返回成功case"
p_id: "5857263"
u_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