Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
backend_auto
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
邓莹莹
backend_auto
Commits
33a4b9bf
Commit
33a4b9bf
authored
Jul 16, 2021
by
edz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
发送弹幕
parent
49fa5260
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
60 additions
and
9 deletions
+60
-9
live_request.py
all_backend_api/live_request.py
+10
-6
live_request.yaml
all_backend_api/live_request.yaml
+10
-1
path_setting.py
path_setting.py
+2
-1
test_sendmsg.py
test_backend_case/live_case/test_sendmsg.py
+22
-0
sendmsg.yaml
test_backend_data/live_data/sendmsg.yaml
+15
-0
topic_reply_create.yaml
test_backend_data/topic_data/topic_reply_create.yaml
+1
-1
No files found.
all_backend_api/live_request.py
View file @
33a4b9bf
...
...
@@ -11,7 +11,7 @@ class living_request(BaseRequest):
self
.
params
[
"msg_id"
]
=
msg_id
self
.
params
[
"user_id"
]
=
user_id
return
self
.
api_send
(
self
.
data
[
"danmu_v2"
])
#主播开播
#主播开播
git
def
pushlive_info
(
self
,
title
,
cover_url
,
notice
,
tag_id
,
clarity
,
device_type
):
self
.
params
[
"title"
]
=
title
self
.
params
[
"cover_url"
]
=
cover_url
...
...
@@ -20,9 +20,13 @@ class living_request(BaseRequest):
self
.
params
[
"clarity"
]
=
clarity
self
.
params
[
"device_type"
]
=
device_type
return
self
.
api_send
(
self
.
data
[
"pushlive_info"
])
#用户-发送弹幕
def
sendmsg
(
self
,
channel_id
,
msg
):
self
.
params
[
"channel_id"
]
=
channel_id
self
.
params
[
"msg"
]
=
msg
return
self
.
api_send
(
self
.
data
[
'sendmsg'
])
if
__name__
==
'__main__'
:
(
living_request
()
.
danmu_v2
(
"739"
,
"1"
))
(
living_request
()
.
pushlive_info
(
"小冤家"
,
"2021/04/22/1003/cef471cff5e6"
,
""
,
"1"
,
"1"
,
"1"
))
\ No newline at end of file
# print (living_request().danmu_v2("739", "1"))
# print (living_request().pushlive_info("小冤家", "2021/04/22/1003/cef471cff5e6", "", "1", "1", "1"))
print
(
living_request
()
.
sendmsg
(
"739"
,
"你好"
))
\ No newline at end of file
all_backend_api/live_request.yaml
View file @
33a4b9bf
...
...
@@ -52,4 +52,13 @@ search_services:
json
:
{}
isLogin
:
1
#用户-发送弹幕
sendmsg
:
method
:
POST
url
:
/api/live/sendmsg
params
:
{}
data
:
channel_id
:
${channel_id}
msg
:
${msg}
json
:
{}
isLogin
:
1
path_setting.py
View file @
33a4b9bf
...
...
@@ -308,7 +308,8 @@ LIVEYAML_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "live_r
DANMU_V2
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/live_data"
,
"danmu_v2.yaml"
)
#直播-主播开播
PUSH_LIVE_INFO
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/live_data"
,
"pushlive_info.yaml"
)
#直播-发送弹幕
SENDMSG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/live_data"
,
"sendmsg.yaml"
)
#商祥页-详情
...
...
test_backend_case/live_case/test_sendmsg.py
View file @
33a4b9bf
import
pytest
from
ids_list
import
get_ids
import
path_setting
from
in_common.base_request
import
BaseRequest
from
all_backend_api.live_request
import
living_request
#@pytest.fixture(scope='function')
#def create_live():
# pass
class
TestSendmsg
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
SENDMSG
)
sendmsg_case
,
sendmsg_data
=
get_ids
(
data
,
"sendmsg"
)
@pytest.mark.parametrize
(
"param"
,
sendmsg_data
,
ids
=
sendmsg_case
)
def
test_sendmsg
(
self
,
param
):
r
=
living_request
()
.
sendmsg
(
param
[
"channel_id"
],
param
[
"msg"
])
if
r
[
"error"
]
==
0
:
assert
r
[
"error"
]
==
param
[
"assert"
]
if
r
[
"error"
]
==
1
:
assert
r
[
"message"
]
==
param
[
"assert"
]
\ No newline at end of file
test_backend_data/live_data/sendmsg.yaml
View file @
33a4b9bf
sendmsg
:
#发送弹幕
-
case
:
"
发送弹幕"
channel_id
:
"
726"
msg
:
"
主播可真美"
assert
:
0
#弹幕内容包含敏感信息,发送失败
-
case
:
"
弹幕内容包含敏感信息,发送失败"
channel_id
:
"
784"
msg
:
"
黄色图片"
assert
:
您输入的内容包含敏感信息,请重新输入
\ No newline at end of file
test_backend_data/topic_data/topic_reply_create.yaml
View file @
33a4b9bf
...
...
@@ -3,7 +3,7 @@ reply_create:
beuzhu
:
'
#
备注:
这个文件有冲突的话,那个版本都行不会影响,回退/接受当前版本都行,因为每次运行content都会改变'
case
:
日记贴一级评论创建--正常校验&创建二级评论--正常校验
channel
:
benzhan
content
:
ces测试+2021-07-1
4 18:15:39
content
:
ces测试+2021-07-1
6 10:25:27
message
:
请勿回复重复内容
message1
:
回复成功
message2
:
你的回复有点频繁,稍后再来
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment