Commit 66d67315 authored by aha's avatar aha

提交代码:更美次卡-更改次卡排序\更美次卡-按次卡sku_id导入,导入校验\更美次卡-按次卡spu_id导入,导入校验

parent d850097e
......@@ -6,8 +6,14 @@ class beautycard_request(BaseRequest):
def __init__(self):
#更美次卡-获取已添加页面次卡spu/sku列表
self.data = self.api_load(path_setting.GET_RELATED_BC_CONFIG)
# 更美次卡-删除/批量删除已添加页面次卡
#更美次卡-删除/批量删除已添加页面次卡
self.data = self.api_load(path_setting.DELETE_RELATED_BC_CONFIG)
#更美次卡-已添加页面全部导出
self.data = self.api_load(path_setting.EXPORT_RELATED_BC_CONFIG)
#更美次卡-更改次卡排序
self.data = self.api_load(path_setting.UPDATE_BC_RANK_CONFIG)
#更美次卡-按次卡sku_id导入,导入校验
self.data = self.api_load(path_setting.CHECK_SKU_IDS_CONFIG)
#更美次卡-获取已添加页面次卡spu/sku列表
def get_related_bc(self, unit_id, bc_sku_id, bc_spu_id, page, page_size):
......@@ -28,6 +34,37 @@ class beautycard_request(BaseRequest):
return self.api_send(self.data["delete_related_bc"])
#更美次卡-已添加页面全部导出
def export_related_bc(self, unit_id, bc_sku_id, bc_spu_id):
self.params["unit_id"] = unit_id
self.params["bc_sku_id"] = bc_sku_id
self.params["bc_spu_id"] = bc_spu_id
return self.api_send(self.data["export_related_bc"])
#更美次卡-更改次卡排序
def update_bc_rank(self, unit_id, related_id, related_type, rank):
self.params["unit_id"] = unit_id
self.params["related_id"] = related_id
self.params["related_type"] = related_type
self.params["rank"] = rank
return self.api_send(self.data["update_bc_rank"])
#更美次卡-按次卡sku_id导入,导入校验
def check_sku_ids(self, bc_skus):
self.params["bc_skus"] = bc_skus
return self.api_send(self.data["check_sku_ids"])
#更美次卡-按次卡spu_id导入,导入校验
def check_spu_ids(self, bc_spus):
self.params["bc_spus"] = bc_spus
return self.api_send(self.data["check_spu_ids"])
if __name__ == '__main__':
print(beautycard_request().get_related_bc("20105", "", "", "0", "10"))
print(beautycard_request().delete_related_bc("19931", "[10163]", "[]", "8"))
print(beautycard_request().export_related_bc("19933", "", ""))
print(beautycard_request().update_bc_rank("20105", "100023", "7", "11"))
\ No newline at end of file
......@@ -24,3 +24,48 @@ delete_related_bc:
related_type : ${related_type}
json : {}
isLogin : 1
#更美次卡-已添加页面全部导出
export_related_bc:
method : GET
url : /achelous/visual/beauty_card/export_related_bc
params :
unit_id : ${unit_id}
bc_sku_id : ${bc_sku_id}
bc_spu_id : ${bc_spu_id}
data : {}
json : {}
isLogin : 1
#更美次卡-更改次卡排序
update_bc_rank:
method : POST
url : /achelous/visual/beauty_card/update_bc_rank
params : {}
data :
unit_id: ${unit_id}
related_id: ${related_id}
related_type: ${related_type}
rank: ${rank}
json : {}
isLogin : 1
#更美次卡-按次卡sku_id导入,导入校验
check_sku_ids:
method : POST
url : /achelous/visual/beauty_card/check_sku_ids
params : {}
data :
bc_skus: ${bc_skus}
json : {}
isLogin : 1
#更美次卡-按次卡spu_id导入,导入校验
check_spu_ids:
method : POST
url : /achelous/visual/beauty_card/check_spu_ids
params : {}
data :
bc_spus: ${bc_spus}
json : {}
isLogin : 1
\ No newline at end of file
......@@ -441,6 +441,22 @@ GET_RELATED_BC = os.path.join(BASE_DIR, "backend_auto/test_om_data/beautycard_da
DELETE_RELATED_BC_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_om_api", "beautycard_request.yaml")
DELETE_RELATED_BC = os.path.join(BASE_DIR, "backend_auto/test_om_data/beautycard_data", "delete_related_bc.yaml")
#更美次卡-已添加页面全部导出
EXPORT_RELATED_BC_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_om_api", "beautycard_request.yaml")
EXPORT_RELATED_BC = os.path.join(BASE_DIR, "backend_auto/test_om_data/beautycard_data", "export_related_bc.yaml")
#更美次卡-已添加页面全部导出
UPDATE_BC_RANK_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_om_api", "beautycard_request.yaml")
UPDATE_BC_RANK = os.path.join(BASE_DIR, "backend_auto/test_om_data/beautycard_data", "update_bc_rank.yaml")
#更美次卡-按次卡sku_id导入,导入校验
CHECK_SKU_IDS_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_om_api", "beautycard_request.yaml")
CHECK_SKU_IDS = os.path.join(BASE_DIR, "backend_auto/test_om_data/beautycard_data", "check_sku_ids.yaml")
#更美次卡-按次卡spu_id导入,导入校验
CHECK_SPU_IDS_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_om_api", "beautycard_request.yaml")
CHECK_SPU_IDS = os.path.join(BASE_DIR, "backend_auto/test_om_data/beautycard_data", "check_spu_ids.yaml")
if __name__ == '__main__':
print("==========",LIVEYAML_CONFIG)
......@@ -2,7 +2,7 @@ reply_create:
- assert1: null
case: 日记贴一级评论创建--正常校验&创建二级评论--正常校验
channel: benzhan
content: ces测试+2021-06-16 16:03:28
content: ces测试+2021-06-16 16:18:35
message: 请勿回复重复内容
message1: 回复成功
message2: 你的回复有点频繁,稍后再来
......
import pytest
import path_setting
from all_om_api.beautycard_request import beautycard_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
#更美次卡-按次卡sku_id导入,导入校验
class TestCheckSkuIds:
data = BaseRequest().api_load(path_setting.CHECK_SKU_IDS)
check_sku_ids_case, check_sku_ids_data = get_ids(data, "check_sku_ids")
@pytest.mark.parametrize("param",check_sku_ids_data,ids=check_sku_ids_case)
def test_check_sku_ids(self,param):
r = beautycard_request().check_sku_ids(param["sku_ids"])
if r["code"] == 0:
if r["data"][0]["status"] == 1:
print("成功导入次卡")
assert r["data"][0]["reason"] == param["assert"]
else:
print("次卡不能成功导入")
assert r["data"][0]["reason"] == param["assert"]
if r["code"] == 1:
print("接口有误")
\ No newline at end of file
import pytest
import path_setting
from all_om_api.beautycard_request import beautycard_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
#更美次卡-按次卡spu_id导入,导入校验
class TestCheckSpuIds:
data = BaseRequest().api_load(path_setting.CHECK_SPU_IDS)
check_spu_ids_case, check_spu_ids_data = get_ids(data, "check_spu_ids")
@pytest.mark.parametrize("param",check_spu_ids_data,ids=check_spu_ids_case)
def test_check_spu_ids(self,param):
r = beautycard_request().check_spu_ids(param["spu_ids"])
if r["code"] == 0:
if r["data"][0]["status"] == 1:
print("成功导入次卡")
assert r["data"][0]["reason"] == param["assert"]
else:
print("次卡不能成功导入")
assert r["data"][0]["reason"] == param["assert"]
if r["code"] == 1:
print("接口有误")
\ No newline at end of file
import pytest
import path_setting
from all_om_api.beautycard_request import beautycard_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
#更美次卡-获取已添加页面次卡spu/sku列表
class TestExportRelatedBc:
data = BaseRequest().api_load(path_setting.EXPORT_RELATED_BC)
export_related_bc_case, export_related_bc_data = get_ids(data, "export_related_bc")
@pytest.mark.parametrize("param",export_related_bc_data,ids=export_related_bc_case)
def test_export_related_bc(self,param):
r = beautycard_request().export_related_bc(param["unit_id"], param["bc_sku_id"], param["bc_spu_id"])
if r["data"]:
print("成功导出已添加页面次卡信息")
assert len(r["data"]["beauty_cards"]) != param["assert"]
if not r["data"]:
print("未导出已添加页面次卡信息")
\ No newline at end of file
import pytest
import path_setting
from all_om_api.beautycard_request import beautycard_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
#更美次卡-更改次卡排序
class TestUpdateBcRank:
data = BaseRequest().api_load(path_setting.UPDATE_BC_RANK)
update_bc_rank_case, update_bc_rank_data = get_ids(data, "update_bc_rank")
@pytest.mark.parametrize("param",update_bc_rank_data,ids=update_bc_rank_case)
def test_update_bc_rank(self,param):
r = beautycard_request().update_bc_rank(param["unit_id"], param["related_id"], param["related_type"], param["rank"])
if r["code"] == 0:
print("成功修改已添加页面该次卡排序")
assert r["data"] == param["assert"]
if r["code"] == 1:
print("未能修改已添加页面该次卡排序")
\ No newline at end of file
#更美次卡-按次卡sku_id导入,导入校验
check_sku_ids:
#按SKU导入-导入单条数据,导入成功
-
case : "按SKU导入-导入单条数据,导入成功"
sku_ids : '[{"import_id":"10066","rank":0,"row":1}]'
assert : ''
#按SKU导入-导入单条数据,ID不存在
- case: "按SKU导入-导入单条数据,ID不存在"
sku_ids: '[{"import_id":"100666","rank":0,"row":1}]'
assert: ID不存在
#按SKU导入-导入单条数据,暂无适用机构
- case: "按SKU导入-导入单条数据,暂无适用机构"
sku_ids: '[{"import_id":"10023","rank":0,"row":1}]'
assert: 暂无适用机构
#按SKU导入-导入单条数据,已下线
- case: "按SKU导入-导入单条数据,已下线"
sku_ids: '[{"import_id":"10022","rank":0,"row":1}]'
assert: 已下线
#按SKU导入-导入单条数据,ID格式错误
- case: "按SKU导入-导入单条数据,ID格式错误"
sku_ids: '[{"import_id":"我","rank":0,"row":1}]'
assert: ID格式错误
#按SKU导入-导入多条数据,导入成功
-
case : "按SKU导入-导入多条数据,导入成功"
sku_ids : '[{"import_id":"10242","rank":0,"row":1},{"import_id":"10243","rank":0,"row":1},{"import_id":"10244","rank":0,"row":1}]'
assert : ''
\ No newline at end of file
#更美次卡-按次卡spu_id导入,导入校验
check_spu_ids:
#按SPU导入-导入单条数据,导入成功
-
case : "按SPU导入-导入单条数据,导入成功"
spu_ids : '[{"import_id":"100052","rank":0,"row":1}]'
assert : ''
#按SPU导入-导入单条数据,ID不存在
- case: "按SPU导入-导入单条数据,ID不存在"
spu_ids: '[{"import_id":"1000522","rank":0,"row":1}]'
assert: ID不存在
#按SPU导入-导入单条数据,暂无适用机构
- case: "按SPU导入-导入单条数据,暂无适用机构"
spu_ids: '[{"import_id":"100022","rank":0,"row":1}]'
assert: 暂无适用机构
#按SPU导入-导入单条数据,已下线
- case: "按SPU导入-导入单条数据,已下线"
spu_ids: '[{"import_id":"100035","rank":0,"row":1}]'
assert: 已下线
#按SPU导入-导入单条数据,ID格式错误
- case: "按SPU导入-导入单条数据,ID格式错误"
spu_ids: '[{"import_id":"我","rank":0,"row":1}]'
assert: ID格式错误
#按SPU导入-导入多条数据,导入成功
-
case : "按SPU导入-导入多条数据,导入成功"
spu_ids : '[{"import_id":"100055","rank":1,"row":1},{"import_id":"100056","rank":2,"row":1},{"import_id":"100057","rank":3,"row":1}]'
assert : ''
\ No newline at end of file
#更美次卡-已添加页面全部导出
export_related_bc:
#按SPU导入-已添加页面全部导出功能
-
case : "按SPU导入-已添加页面全部导出功能"
unit_id : "19896"
bc_sku_id : ""
bc_spu_id : ""
assert: 0
#按SKU导入-已添加页面全部导出功能
-
case : "按SKU导入-已添加页面全部导出功能"
unit_id : "19933"
bc_sku_id : ""
bc_spu_id : ""
assert: 0
\ No newline at end of file
#更美次卡-更改次卡排序
update_bc_rank:
#按SPU导入-更改次卡排序
-
case : "按SPU导入-更改次卡排序"
unit_id : "20105"
related_id : "100023"
related_type : "7"
rank : "77"
assert: 1
#按SKU导入-更改次卡排序
-
case: "按SKU导入-更改次卡排序"
unit_id: "20106"
related_id: "10065"
related_type: "8"
rank: "11"
assert: 1
\ 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