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
e1ce206b
Commit
e1ce206b
authored
Jul 16, 2021
by
aha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
直播
parent
248da587
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
140 additions
and
21 deletions
+140
-21
janus_live_request.py
all_backend_api/janus_live_request.py
+13
-5
janus_live_request.yaml
all_backend_api/janus_live_request.yaml
+11
-0
live_request.py
all_backend_api/live_request.py
+13
-0
live_request.yaml
all_backend_api/live_request.yaml
+11
-16
path_setting.py
path_setting.py
+12
-0
test_m_get_channel_status.py
...backend_case/janus_live_case/test_m_get_channel_status.py
+19
-0
test_enter.py
test_backend_case/live_case/test_enter.py
+18
-0
test_leave.py
test_backend_case/live_case/test_leave.py
+18
-0
m_get_channel_status.yaml
test_backend_data/janus_live_data/m_get_channel_status.yaml
+8
-0
enter.yaml
test_backend_data/live_data/enter.yaml
+9
-0
leave.yaml
test_backend_data/live_data/leave.yaml
+8
-0
No files found.
all_backend_api/janus_live_request.py
View file @
e1ce206b
...
@@ -10,6 +10,7 @@ class live_request(BaseRequest):
...
@@ -10,6 +10,7 @@ class live_request(BaseRequest):
self
.
data
=
self
.
api_load
(
path_setting
.
ADDLIVESERVICE_CONFIG
)
self
.
data
=
self
.
api_load
(
path_setting
.
ADDLIVESERVICE_CONFIG
)
self
.
data
=
self
.
api_load
(
path_setting
.
DELETELIVESERVICE_CONFIG
)
self
.
data
=
self
.
api_load
(
path_setting
.
DELETELIVESERVICE_CONFIG
)
self
.
data
=
self
.
api_load
(
path_setting
.
DELETEGIFT_CONFIG
)
self
.
data
=
self
.
api_load
(
path_setting
.
DELETEGIFT_CONFIG
)
self
.
data
=
self
.
api_load
(
path_setting
.
M_GET_CHANNEL_STATUS_CONFIG
)
#主播-推荐袋美购列表展示
#主播-推荐袋美购列表展示
def
live_services
(
self
,
channel_id
,
stream_id
,
offset
,
size
):
def
live_services
(
self
,
channel_id
,
stream_id
,
offset
,
size
):
...
@@ -73,8 +74,15 @@ class live_request(BaseRequest):
...
@@ -73,8 +74,15 @@ class live_request(BaseRequest):
self
.
params
[
"version"
]
=
version
self
.
params
[
"version"
]
=
version
return
self
.
api_send
(
self
.
data
[
"delete_live_gift"
])
return
self
.
api_send
(
self
.
data
[
"delete_live_gift"
])
#获取直播间状态
def
m_get_channel_status
(
self
,
channel_id
,
version
,
device_id
=
'97B6764B-2135-4761-9911-701C38CBC272'
):
self
.
params
[
"channel_id"
]
=
channel_id
self
.
params
[
"version"
]
=
version
return
self
.
api_send
(
self
.
data
[
"m_get_channel_status"
])
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
print
(
live_request
()
.
live_services
(
"745"
,
"4177"
,
"0"
,
"10"
))
# print(live_request().live_services("745", "4177", "0", "10"))
print
(
live_request
()
.
search_service
(
"beijing"
,
"745"
,
""
,
"0"
,
"20"
,
"7.45.0"
))
# print(live_request().search_service("beijing", "745", "", "0", "20", "7.45.0"))
print
(
live_request
()
.
add_live_service
(
"745"
,
"560641"
,
"7.45.0"
))
# print(live_request().add_live_service("745", "560641", "7.45.0"))
print
(
live_request
()
.
delete_live_service
(
"745"
,
"7242"
,
"7.45.0"
))
# print(live_request().delete_live_service("745", "7242", "7.45.0"))
\ No newline at end of file
print
(
live_request
()
.
m_get_channel_status
(
"745"
,
"7.46.0"
))
\ No newline at end of file
all_backend_api/janus_live_request.yaml
View file @
e1ce206b
...
@@ -78,4 +78,15 @@ delete_live_gift:
...
@@ -78,4 +78,15 @@ delete_live_gift:
json
:
{}
json
:
{}
isLogin
:
1
isLogin
:
1
#获取直播间状态
m_get_channel_status
:
method
:
GET
url
:
/api/janus/live/m/get_channel_status
params
:
channel_id
:
${channel_id}
version
:
${version}
data
:
{}
json
:
{}
isLogin
:
1
all_backend_api/live_request.py
View file @
e1ce206b
...
@@ -21,6 +21,19 @@ class living_request(BaseRequest):
...
@@ -21,6 +21,19 @@ class living_request(BaseRequest):
self
.
params
[
"device_type"
]
=
device_type
self
.
params
[
"device_type"
]
=
device_type
return
self
.
api_send
(
self
.
data
[
"pushlive_info"
])
return
self
.
api_send
(
self
.
data
[
"pushlive_info"
])
#观众进入直播间
def
enter
(
self
,
channel_id
,
from_source
,
version
,
device_id
=
"97B6764B-2135-4761-9911-701C38CBC272"
):
self
.
params
[
"channel_id"
]
=
channel_id
self
.
params
[
"from_source"
]
=
from_source
self
.
params
[
"version"
]
=
version
return
self
.
api_send
(
self
.
data
[
"enter"
])
#观众离开直播间
def
leave
(
self
,
channel_id
,
version
,
device_id
=
"97B6764B-2135-4761-9911-701C38CBC272"
):
self
.
params
[
"channel_id"
]
=
channel_id
self
.
params
[
"version"
]
=
version
return
self
.
api_send
(
self
.
data
[
"leave"
])
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
...
...
all_backend_api/live_request.yaml
View file @
e1ce206b
...
@@ -24,30 +24,25 @@ pushlive_info:
...
@@ -24,30 +24,25 @@ pushlive_info:
json
:
{}
json
:
{}
isLogin
:
1
isLogin
:
1
#
主播-推荐袋美购列表展示
#
观众进入直播间
live_services
:
enter
:
method
:
GET
method
:
get
url
:
/api/
janus/live/live_services
url
:
/api/
live/enter
params
:
params
:
channel_id
:
${channel_id}
channel_id
:
${channel_id}
stream_id
:
${stream_id}
from_source
:
${from_source}
offset
:
${offset}
version
:
${version}
size
:
${size}
data
:
{}
data
:
{}
json
:
{}
json
:
{}
isLogin
:
1
isLogin
:
1
#
主播-推荐袋商品捜索功能
#
观众离开直播间
search_services
:
leave
:
method
:
GET
method
:
get
url
:
/api/
janus/live/search_services
url
:
/api/
live/leave
params
:
params
:
current_city_id
:
${current_city_id}
channel_id
:
${channel_id}
channel_id
:
${channel_id}
query
:
${query}
version
:
${version}
offset
:
${offset}
size
:
${size}
trace_id
:
${trace_id}
data
:
{}
data
:
{}
json
:
{}
json
:
{}
isLogin
:
1
isLogin
:
1
...
...
path_setting.py
View file @
e1ce206b
...
@@ -573,6 +573,18 @@ DELETELIVESERVICE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus
...
@@ -573,6 +573,18 @@ DELETELIVESERVICE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus
DELETEGIFT_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"janus_live_request.yaml"
)
DELETEGIFT_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"janus_live_request.yaml"
)
DELETEGIFT
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/janus_live_data"
,
"delete_live_gift.yaml"
)
DELETEGIFT
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/janus_live_data"
,
"delete_live_gift.yaml"
)
#获取直播间状态
M_GET_CHANNEL_STATUS_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"janus_live_request.yaml"
)
M_GET_CHANNEL_STATUS
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/janus_live_data"
,
"m_get_channel_status.yaml"
)
#观众进入直播间
ENTER_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"live_request.yaml"
)
ENTER
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/live_data"
,
"enter.yaml"
)
#观众离开直播间
LEAVE_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"live_request.yaml"
)
LEAVE
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/live_data"
,
"leave.yaml"
)
#免费招募活动详情
#免费招募活动详情
FREE_RECRUIT_DETAIL_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"feed_request.yaml"
)
FREE_RECRUIT_DETAIL_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"feed_request.yaml"
)
FREE_RECRUIT_DETAIL
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/feed_data"
,
"free_recruit_detail.yaml"
)
FREE_RECRUIT_DETAIL
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/feed_data"
,
"free_recruit_detail.yaml"
)
...
...
test_backend_case/janus_live_case/test_m_get_channel_status.py
0 → 100644
View file @
e1ce206b
import
pytest
import
path_setting
from
all_backend_api.janus_live_request
import
live_request
from
ids_list
import
get_ids
from
in_common.base_request
import
BaseRequest
class
TestMGetChannelStatus
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
M_GET_CHANNEL_STATUS
)
m_get_channel_status_case
,
m_get_channel_status_data
=
get_ids
(
data
,
"m_get_channel_status"
)
@pytest.mark.parametrize
(
"param"
,
m_get_channel_status_data
,
ids
=
m_get_channel_status_case
)
def
test_m_get_channel_status_data
(
self
,
param
):
print
(
"查看直播状态啦~~~"
)
r
=
live_request
()
.
m_get_channel_status
(
param
[
"channel_id"
],
param
[
"version"
])
if
r
[
"error"
]
==
0
:
assert
r
[
"data"
][
"status"
]
==
param
[
"assert"
]
\ No newline at end of file
test_backend_case/live_case/test_enter.py
0 → 100644
View file @
e1ce206b
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
TestEnter
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
ENTER
)
enter_case
,
enter_data
=
get_ids
(
data
,
"enter"
)
@pytest.mark.parametrize
(
"param"
,
enter_data
,
ids
=
enter_case
)
def
test_enter
(
self
,
param
):
r
=
living_request
()
.
enter
(
param
[
"channel_id"
],
param
[
"from_source"
],
param
[
"version"
])
print
(
"观众进入直播间啦~~~"
)
if
r
[
"error"
]
==
0
:
assert
r
[
"error"
]
==
param
[
"assert"
]
\ No newline at end of file
test_backend_case/live_case/test_leave.py
0 → 100644
View file @
e1ce206b
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
TestLeave
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
LEAVE
)
leave_case
,
leave_data
=
get_ids
(
data
,
"leave"
)
@pytest.mark.parametrize
(
"param"
,
leave_data
,
ids
=
leave_case
)
def
test_leave
(
self
,
param
):
r
=
living_request
()
.
leave
(
param
[
"channel_id"
],
param
[
"version"
])
print
(
"观众离开直播间了,呜呜呜"
)
if
r
[
"error"
]
==
0
:
assert
r
[
"error"
]
==
param
[
"assert"
]
\ No newline at end of file
test_backend_data/janus_live_data/m_get_channel_status.yaml
0 → 100644
View file @
e1ce206b
m_get_channel_status
:
#查看直播状态
-
case
:
"
查看直播状态"
channel_id
:
"
745"
version
:
"
7.45.0"
assert
:
True
\ No newline at end of file
test_backend_data/live_data/enter.yaml
0 → 100644
View file @
e1ce206b
enter
:
#观众从app进入直播间
-
case
:
"
观众从app进入直播间"
channel_id
:
"
745"
from_source
:
"
app"
version
:
"
7.45.0"
assert
:
0
\ No newline at end of file
test_backend_data/live_data/leave.yaml
0 → 100644
View file @
e1ce206b
leave
:
#观众离开直播间了,呜呜呜
-
case
:
"
观众离开直播间了,呜呜呜"
channel_id
:
"
745"
version
:
"
7.45.0"
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