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
359bc78c
Commit
359bc78c
authored
Apr 23, 2021
by
edz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
live-push_live_info
parent
728f47ab
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
31 additions
and
13 deletions
+31
-13
live_request.py
all_backend_api/live_request.py
+3
-4
live_request.yaml
all_backend_api/live_request.yaml
+1
-0
base_request.py
in_common/base_request.py
+6
-1
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
+5
-1
danmu_v2.yaml
test_backend_data/live_data/danmu_v2.yaml
+1
-0
pushlive_info.yaml
test_backend_data/live_data/pushlive_info.yaml
+12
-4
No files found.
all_backend_api/live_request.py
View file @
359bc78c
...
...
@@ -5,7 +5,6 @@ from in_common.base_request import BaseRequest
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
...
...
@@ -24,5 +23,5 @@ class living_request(BaseRequest):
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
(
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 @
359bc78c
...
...
@@ -22,4 +22,5 @@ pushlive_info:
device_type
:
${device_type}
data
:
{}
json
:
{}
isLogin
:
1
in_common/base_request.py
View file @
359bc78c
...
...
@@ -80,13 +80,18 @@ class BaseRequest:
s
=
LoginFunction
()
.
get_session
()
# 调用具体case的url
print
(
req
[
'method'
])
print
(
url_host
+
req
[
'url'
])
print
(
req
.
get
(
'params'
))
print
(
req
.
get
(
'data'
))
r
=
s
.
request
(
req
[
'method'
],
url
=
url_host
+
req
[
'url'
],
params
=
req
.
get
(
'params'
),
# headers=user_headers,
data
=
req
.
get
(
'data'
),
json
=
req
.
get
(
'json'
)
json
=
req
.
get
(
'json'
),
# proxies={"http":"172.30.9.226:8888"}
)
return
r
.
json
()
...
...
test_backend_case/live_case/test_danmu_v2.py
View file @
359bc78c
...
...
@@ -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
else
:
assert
r
[
"message"
]
==
param
[
"assert_message"
]
\ No newline at end of file
test_backend_case/live_case/test_pushlive_info.py
View file @
359bc78c
...
...
@@ -11,7 +11,10 @@ class TestPushLiveInfo:
@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"
])
print
(
'--------'
,
r
)
if
r
[
"error"
]
==
0
:
assert
r
[
"error"
]
==
param
[
"assert"
]
else
:
assert
r
[
"message"
]
==
param
[
'assert_message0'
]
\ No newline at end of file
test_backend_data/live_data/danmu_v2.yaml
View file @
359bc78c
...
...
@@ -6,6 +6,7 @@ danmu_v2:
msg_id
:
1
user_id
:
"
"
assert
:
0
assert_message
:
"
获取弹幕失败"
#获取弹幕失败case
# -
...
...
test_backend_data/live_data/pushlive_info.yaml
View file @
359bc78c
...
...
@@ -5,34 +5,42 @@ push_live_info:
title
:
"
小冤家"
cover_url
:
"
2021/04/22/1003/cef471cff5e6"
notice
:
"
"
tag_id
:
"
快乐就是我的标签
"
tag_id
:
"
1
"
clarity
:
"
1"
device_type
:
"
1"
assert
:
0
# assert_message1 : "请登录后再试"
assert_message0
:
"
请登录后再试"
-
case
:
"
主播开播成功-填写标签"
title
:
"
小冤家"
cover_url
:
"
2021/04/22/1003/cef471cff5e6"
notice
:
"
公告"
tag_id
:
"
快乐就是我的标签
"
tag_id
:
"
1
"
clarity
:
"
1"
device_type
:
"
1"
assert
:
0
# assert_message1 : "请登录后再试"
assert_message0
:
"
请登录后再试"
-
case
:
"
主播开播成功-清晰度:高清开播"
title
:
"
小冤家"
cover_url
:
"
2021/04/22/1003/cef471cff5e6"
notice
:
"
公告"
tag_id
:
"
快乐就是我的标签
"
tag_id
:
"
1
"
clarity
:
"
2"
device_type
:
"
1"
assert
:
0
# assert_message1 : "请登录后再试"
assert_message0
:
"
请登录后再试"
-
case
:
"
主播开播成功-清晰度:超高清开播"
title
:
"
小冤家"
cover_url
:
"
2021/04/22/1003/cef471cff5e6"
notice
:
"
公告"
tag_id
:
"
快乐就是我的标签
"
tag_id
:
"
1
"
clarity
:
"
2"
device_type
:
"
1"
assert
:
0
# assert_message1 : "请登录后再试"
assert_message0
:
"
请登录后再试"
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