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
4f77bd45
Commit
4f77bd45
authored
Apr 21, 2021
by
edz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crk提交
parent
cfca6890
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
74 additions
and
3 deletions
+74
-3
live_request.py
all_backend_api/live_request.py
+17
-0
live_request.yaml
all_backend_api/live_request.yaml
+10
-0
host.yaml
host.yaml
+2
-2
path_setting.py
path_setting.py
+8
-1
__init__.py
test_backend_case/live_case/__init__.py
+0
-0
test_danmu_v2.py
test_backend_case/live_case/test_danmu_v2.py
+20
-0
__init__.py
test_backend_data/live_data/__init__.py
+0
-0
danmu_v2.yaml
test_backend_data/live_data/danmu_v2.yaml
+17
-0
No files found.
all_backend_api/live_request.py
0 → 100644
View file @
4f77bd45
import
path_setting
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
self
.
params
[
"msg_id"
]
=
msg_id
self
.
params
[
"user_id"
]
=
user_id
return
self
.
api_send
(
self
.
data
[
"danmu_v2"
])
if
__name__
==
'__main__'
:
(
living_request
()
.
danmu_v2
(
"739"
,
"1"
,
""
))
\ No newline at end of file
all_backend_api/live_request.yaml
0 → 100644
View file @
4f77bd45
danmu_v2
:
method
:
get
url
:
/api/live/danmu_v2
params
:
channel_id
:
${channel_id}
msg_id
:
${msg_id}
user_id
:
${user_id}
data
:
{}
json
:
{}
\ No newline at end of file
host.yaml
View file @
4f77bd45
develop_host
:
#
backend: http://backend.paas-develop.env
doctor
:
http://doctor.paas-develop.env
backend
:
http://backend.paas-develop.env
#
doctor: http://doctor.paas-develop.env
path_setting.py
View file @
4f77bd45
...
...
@@ -8,6 +8,7 @@ LOGIN_FUNCTION_DATA = os.path.join(BASE_DIR, "backend_auto", "login_session_func
APYAML_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"account_request.yaml"
)
LOGIN_VFC
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/account_data"
,
"login_vfc.yaml"
)
DIARY_DATA_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"diary_data_request.yaml"
)
DIARY_DATA
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/account_data"
,
"diary_data.yaml"
)
...
...
@@ -36,6 +37,12 @@ HOSPITAL_DOCTOR = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hospita
HOME_V5_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"service_request.yaml"
)
HOME_V5
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/service_data"
,
"home_v5.yaml"
)
#直播
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"
)
if
__name__
==
'__main__'
:
print
(
"=========="
,
HOST
YAML_CONFIG
)
print
(
"=========="
,
LIVE
YAML_CONFIG
)
test_backend_case/live_case/__init__.py
0 → 100644
View file @
4f77bd45
test_backend_case/live_case/test_danmu_v2.py
0 → 100644
View file @
4f77bd45
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
TestDanmuV2
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
DANMU_V2
)
danmuv2_case
,
danmuv2_data
=
get_ids
(
data
,
"danmu_v2"
)
@pytest.mark.parametrize
(
"param"
,
danmuv2_data
,
ids
=
danmuv2_case
)
def
test_danmu_v2
(
self
,
param
):
print
(
param
)
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
test_backend_data/live_data/__init__.py
0 → 100644
View file @
4f77bd45
test_backend_data/live_data/danmu_v2.yaml
0 → 100644
View file @
4f77bd45
danmu_v2
:
#成功获取弹幕case
-
case
:
"
成功获取弹幕"
channel_id
:
"
739"
msg_id
:
1
user_id
:
"
"
assert
:
0
#获取弹幕失败case
-
case
:
"
获取弹幕失败-进入房间失败"
channel_id
:
"
"
msg_id
:
1
user_id
:
"
"
assert
:
0
\ No newline at end of file
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