Commit d0ce4e0b authored by edz's avatar edz

om

parent b23d501d
import path_setting
from in_common.base_request import BaseRequest
class achelous_request(BaseRequest):
def __init__(self):
self.data = self.api_load(path_setting.ACHELOUS_REQUEST_CONFIG)
def batch_add_service(self, stream_id, service_item_ids):
self.params["stream_id"] = stream_id
self.params["service_item_ids"] = service_item_ids
return self.api_send(self.data["batch_add_service"])
def batch_del_service(self, stream_id, service_item_ids):
self.params["stream_id"] = stream_id
self.params["service_item_ids"] = service_item_ids
return self.api_send(self.data["batch_add_service"])
if __name__ == "__main__":
print(achelous_request().batch_add_service("4176", "73809,23508,33823"))
print(achelous_request().batch_del_service("4176","7312,7311"))
\ No newline at end of file
batch_add_service:
method: post
url: /achelous/live/batch_add_service
params: {}
data:
stream_id: ${stream_id}
service_item_ids: ${service_item_ids}
json: {}
isLogin: 1
batch_del_service:
method: post
url: /achelous/live/batch_del_service
params: {}
data:
stream_id: ${stream_id}
service_item_ids: ${service_item_ids}
json: {}
isLogin: 1
\ No newline at end of file
......@@ -544,6 +544,10 @@ CHECK_SKU_IDS = os.path.join(BASE_DIR, "backend_auto/test_om_data/beautycard_dat
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")
#om-achelous
ACHELOUS_REQUEST_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_om_api", "achelous_request.yaml")
#直播-om后台-批量添加美购
BATCH_ADD_SERVICE = os.path.join(BASE_DIR, "backend_auto/test_om_data/achelous_data", "batch_add_service.yaml")
#次卡商详页
BEAUTY_CARD_DETAIL = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_data", "beauty_card_detail.yaml")
......
......@@ -3,7 +3,11 @@ reply_create:
beuzhu: '# 备注: 这个文件有冲突的话,那个版本都行不会影响,回退/接受当前版本都行,因为每次运行content都会改变'
case: 日记贴一级评论创建--正常校验&创建二级评论--正常校验
channel: benzhan
<<<<<<< Updated upstream
content: ces测试+2021-07-28 19:16:19
=======
content: ces测试+2021-07-26 18:10:54
>>>>>>> Stashed changes
message: 请勿回复重复内容
message1: 回复成功
message2: 你的回复有点频繁,稍后再来
......
import pytest
import path_setting
from all_om_api.achelous_request import achelous_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
class TestBatchAddService:
data = BaseRequest().api_load(path_setting.BATCH_ADD_SERVICE)
batch_add_service_case, batch_add_service_data = get_ids(data, "batch_add_service")
@pytest.mark.parametrize("param",batch_add_service_data,ids=batch_add_service_case)
def test_batch_add_service(self,param):
r = achelous_request().batch_add_service(param['stream_id'],param['service_item_ids'])
#print(type(r["failed_service_item_ids"]))
if r.get("code") == 1:
assert r['message'] == param["assert"]
elif len(r["failed_service_item_ids"]) == 0:
assert r["success_service_item_ids"] == param["assert2"]
elif r["success_service_item_ids"] == 0:
assert r["success_service_item_ids"] == param["assert1"]
live_request().delete_live_service("745", "7242", "7.45.0")
\ No newline at end of file
batch_add_service:
-
case: "om-直播-批量添加一件美购"
stream_id: "4166"
service_item_ids: "73809"
assert2: [73809]
-
case: "om-直播-批量添加多件美购"
stream_id: "4166"
service_item_ids: "23508,33823"
assert2: [33823,23508]
-
case: "om-直播添加商品-输入不合法符号"
stream_id: "4166"
service_item_ids: "73809,23508,33823"
assert: "请输入合法的SKU ID以,隔开"
-
case: "om-直播-添加错误美购id"
stream_id: "4166"
service_item_ids: "235"
assert1: '[235]'
\ 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