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
728f47ab
Commit
728f47ab
authored
Apr 22, 2021
by
edz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
22号
parent
e8ca6669
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
98 additions
and
14 deletions
+98
-14
live_request.py
all_backend_api/live_request.py
+14
-2
live_request.yaml
all_backend_api/live_request.yaml
+17
-2
path_setting.py
path_setting.py
+2
-0
test_danmu_v2.py
test_backend_case/live_case/test_danmu_v2.py
+3
-3
test_pushlive_info.py
test_backend_case/live_case/test_pushlive_info.py
+17
-0
danmu_v2.yaml
test_backend_data/live_data/danmu_v2.yaml
+7
-7
pushlive_info.yaml
test_backend_data/live_data/pushlive_info.yaml
+38
-0
No files found.
all_backend_api/live_request.py
View file @
728f47ab
...
...
@@ -6,11 +6,23 @@ class living_request(BaseRequest):
def
__init__
(
self
):
self
.
data
=
self
.
api_load
(
path_setting
.
LIVEYAML_CONFIG
)
print
(
'====='
,
self
.
data
)
#获取弹幕
def
danmu_v2
(
self
,
channel_id
,
msg_id
,
user_id
=
""
):
self
.
params
[
"channel_id"
]
=
channel_id
self
.
params
[
"msg_id"
]
=
msg_id
self
.
params
[
"user_id"
]
=
user_id
return
self
.
api_send
(
self
.
data
[
"danmu_v2"
])
#主播开播
def
pushlive_info
(
self
,
title
,
cover_url
,
notice
,
tag_id
,
clarity
,
device_type
):
self
.
params
[
"title"
]
=
title
self
.
params
[
"cover_url"
]
=
cover_url
self
.
params
[
"notice"
]
=
notice
self
.
params
[
"tag_id"
]
=
tag_id
self
.
params
[
"clarity"
]
=
clarity
self
.
params
[
"device_type"
]
=
device_type
return
self
.
api_send
(
self
.
data
[
"pushlive_info"
])
if
__name__
==
'__main__'
:
(
living_request
()
.
danmu_v2
(
"739"
,
"1"
,
""
))
\ No newline at end of file
(
living_request
()
.
danmu_v2
(
"739"
,
"1"
))
(
living_request
()
.
pushlive_info
(
"小冤家"
,
"2021/04/22/1003/cef471cff5e6"
,
""
,
"1"
,
"1"
,
"1"
))
\ No newline at end of file
all_backend_api/live_request.yaml
View file @
728f47ab
#获取弹幕
danmu_v2
:
method
:
get
url
:
/api/live/danmu_v2
...
...
@@ -6,4 +7,19 @@ danmu_v2:
msg_id
:
${msg_id}
user_id
:
${user_id}
data
:
{}
json
:
{}
\ No newline at end of file
json
:
{}
#主播开播
pushlive_info
:
method
:
get
url
:
/api/live/push_live_info
params
:
title
:
${title}
cover_url
:
${cover_url}
notice
:
${notice}
tag_id
:
${tag_id}
clarity
:
${clarity}
device_type
:
${device_type}
data
:
{}
json
:
{}
path_setting.py
View file @
728f47ab
...
...
@@ -67,6 +67,8 @@ HOME_V5=os.path.join(BASE_DIR,"backend_auto/test_backend_data/service_data","hom
LIVEYAML_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"live_request.yaml"
)
#直播-获取弹幕
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"
)
...
...
test_backend_case/live_case/test_danmu_v2.py
View file @
728f47ab
...
...
@@ -15,5 +15,5 @@ class TestDanmuV2:
r
=
living_request
()
.
danmu_v2
(
param
[
"channel_id"
],
param
[
"msg_id"
],
param
[
"user_id"
])
if
r
[
"error"
]
==
0
:
assert
r
[
"error"
]
==
param
[
"assert"
]
if
r
[
"error"
]
==
1
:
assert
r
[
"error"
]
==
param
[
"assert"
]
\ No newline at end of file
# if r["error"] == 1:
# assert r["error"] == param["assert"]
\ No newline at end of file
test_backend_case/live_case/test_pushlive_info.py
0 → 100644
View file @
728f47ab
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
class
TestPushLiveInfo
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
PUSH_LIVE_INFO
)
pushliveinfo_case
,
pushliveinfo_data
=
get_ids
(
data
,
"push_live_info"
)
@pytest.mark.parametrize
(
"param"
,
pushliveinfo_data
,
ids
=
pushliveinfo_case
)
def
test_pushlive_info
(
self
,
param
):
print
(
param
)
r
=
living_request
()
.
pushlive_info
(
param
[
"title"
],
param
[
"cover_url"
],
param
[
"notice"
],
param
[
"tag_id"
],
param
[
"clarity"
],
param
[
"device_type"
])
if
r
[
"error"
]
==
0
:
assert
r
[
"error"
]
==
param
[
"assert"
]
test_backend_data/live_data/danmu_v2.yaml
View file @
728f47ab
...
...
@@ -8,9 +8,9 @@ danmu_v2:
assert
:
0
#获取弹幕失败case
-
case
:
"
获取弹幕失败-进入房间失败"
channel_id
:
"
"
msg_id
:
1
user_id
:
"
"
assert
:
0
\ No newline at end of file
# -
# case: "获取弹幕失败-获取房间信息失败"
# channel_id: ""
# msg_id: 1
# user_id: ""
# assert: 0
\ No newline at end of file
test_backend_data/live_data/pushlive_info.yaml
0 → 100644
View file @
728f47ab
push_live_info
:
#主播成功开播case
-
case
:
"
主播开播成功-未填写标签"
title
:
"
小冤家"
cover_url
:
"
2021/04/22/1003/cef471cff5e6"
notice
:
"
"
tag_id
:
"
快乐就是我的标签"
clarity
:
"
1"
device_type
:
"
1"
assert
:
0
-
case
:
"
主播开播成功-填写标签"
title
:
"
小冤家"
cover_url
:
"
2021/04/22/1003/cef471cff5e6"
notice
:
"
公告"
tag_id
:
"
快乐就是我的标签"
clarity
:
"
1"
device_type
:
"
1"
assert
:
0
-
case
:
"
主播开播成功-清晰度:高清开播"
title
:
"
小冤家"
cover_url
:
"
2021/04/22/1003/cef471cff5e6"
notice
:
"
公告"
tag_id
:
"
快乐就是我的标签"
clarity
:
"
2"
device_type
:
"
1"
assert
:
0
-
case
:
"
主播开播成功-清晰度:超高清开播"
title
:
"
小冤家"
cover_url
:
"
2021/04/22/1003/cef471cff5e6"
notice
:
"
公告"
tag_id
:
"
快乐就是我的标签"
clarity
:
"
2"
device_type
:
"
1"
assert
:
0
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