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
491f1609
Commit
491f1609
authored
Jul 30, 2021
by
aha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
om后台-弹出美券、用户-领取美券
parent
8a791c22
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
113 additions
and
4 deletions
+113
-4
janus_live_request.py
all_backend_api/janus_live_request.py
+19
-2
janus_live_request.yaml
all_backend_api/janus_live_request.yaml
+25
-2
path_setting.py
path_setting.py
+8
-0
test_get_gift.py
test_backend_case/janus_live_case/test_get_gift.py
+22
-0
test_pop_gift.py
test_backend_case/janus_live_case/test_pop_gift.py
+22
-0
get_gift.yaml
test_backend_data/janus_live_data/get_gift.yaml
+8
-0
pop_gift.yaml
test_backend_data/janus_live_data/pop_gift.yaml
+9
-0
No files found.
all_backend_api/janus_live_request.py
View file @
491f1609
...
@@ -9,6 +9,8 @@ class live_request(BaseRequest):
...
@@ -9,6 +9,8 @@ class live_request(BaseRequest):
self
.
data
=
self
.
api_load
(
path_setting
.
SEARCHSERVICE_CONFIG
)
self
.
data
=
self
.
api_load
(
path_setting
.
SEARCHSERVICE_CONFIG
)
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
.
POP_SERVICE_CONFIG
)
self
.
data
=
self
.
api_load
(
path_setting
.
POP_SERVICE_CONFIG
)
self
.
data
=
self
.
api_load
(
path_setting
.
POP_GIFT_CONFIG
)
self
.
data
=
self
.
api_load
(
path_setting
.
GET_GIFT_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
)
self
.
data
=
self
.
api_load
(
path_setting
.
M_GET_CHANNEL_STATUS_CONFIG
)
...
@@ -68,6 +70,19 @@ class live_request(BaseRequest):
...
@@ -68,6 +70,19 @@ class live_request(BaseRequest):
self
.
params
[
"version"
]
=
version
self
.
params
[
"version"
]
=
version
return
self
.
api_send
(
self
.
data
[
"pop_service"
])
return
self
.
api_send
(
self
.
data
[
"pop_service"
])
#om后台-弹出美券
def
pop_gift
(
self
,
stream_id
,
gift_id
,
version
,
device_id
=
'97B6764B-2135-4761-9911-701C38CBC272'
):
self
.
params
[
"stream_id"
]
=
stream_id
self
.
params
[
"gift_id"
]
=
gift_id
self
.
params
[
"version"
]
=
version
return
self
.
api_send
(
self
.
data
[
"pop_gift"
])
#用户-领取美券
def
get_gift
(
self
,
gift_id
,
version
,
device_id
=
'97B6764B-2135-4761-9911-701C38CBC272'
):
self
.
params
[
"gift_id"
]
=
gift_id
self
.
params
[
"version"
]
=
version
return
self
.
api_send
(
self
.
data
[
"get_gift"
])
#主播-推荐袋删除商品
#主播-推荐袋删除商品
def
delete_live_service
(
self
,
channel_id
,
live_service_id
,
version
,
device_id
=
'97B6764B-2135-4761-9911-701C38CBC272'
):
def
delete_live_service
(
self
,
channel_id
,
live_service_id
,
version
,
device_id
=
'97B6764B-2135-4761-9911-701C38CBC272'
):
self
.
params
[
"channel_id"
]
=
channel_id
self
.
params
[
"channel_id"
]
=
channel_id
...
@@ -119,4 +134,6 @@ if __name__ == '__main__':
...
@@ -119,4 +134,6 @@ if __name__ == '__main__':
#print(live_request().m_get_channel_status("745", "7.46.0"))
#print(live_request().m_get_channel_status("745", "7.46.0"))
# print(live_request().mark_live_service("4233", "745", "7269", "1", "746.0"))
# print(live_request().mark_live_service("4233", "745", "7269", "1", "746.0"))
# print(live_request().audience_services("4179","739","0","20"))
# print(live_request().audience_services("4179","739","0","20"))
print
(
live_request
()
.
pop_service
(
"4266"
,
"7324"
,
"1"
,
"746.0"
))
# print(live_request().pop_service("4266", "7324", "1", "746.0"))
\ No newline at end of file
# print(live_request().pop_gift("4271", "59124", "746.0"))
print
(
live_request
()
.
get_gift
(
"59124"
,
"746.0"
))
\ No newline at end of file
all_backend_api/janus_live_request.yaml
View file @
491f1609
...
@@ -52,7 +52,7 @@ add_live_service:
...
@@ -52,7 +52,7 @@ add_live_service:
json
:
{}
json
:
{}
isLogin
:
1
isLogin
:
1
#主播-添加商品后,购物车上方弹出商品卡片
#主播-添加商品后,购物车上方弹出商品卡片
pop_service
:
pop_service
:
method
:
GET
method
:
GET
url
:
/api/janus/live/pop_service
url
:
/api/janus/live/pop_service
...
@@ -62,7 +62,30 @@ pop_service:
...
@@ -62,7 +62,30 @@ pop_service:
pop_type
:
${pop_type}
pop_type
:
${pop_type}
version
:
${version}
version
:
${version}
data
:
{}
data
:
{}
json
:
{
}
json
:
{}
isLogin
:
1
#om后台-弹出美券
pop_gift
:
method
:
GET
url
:
/api/janus/live/pop_gift
params
:
stream_id
:
${stream_id}
gift_id
:
${gift_id}
version
:
${version}
data
:
{}
json
:
{}
isLogin
:
1
#用户-领取美券
get_gift
:
method
:
POST
url
:
/api/janus/live/get_gift
params
:
version
:
${version}
data
:
gift_id
:
${gift_id}
json
:
{}
isLogin
:
1
isLogin
:
1
#主播-推荐袋删除商品
#主播-推荐袋删除商品
...
...
path_setting.py
View file @
491f1609
...
@@ -602,6 +602,14 @@ ADDLIVESERVICE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_li
...
@@ -602,6 +602,14 @@ ADDLIVESERVICE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/janus_li
POP_SERVICE_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"janus_live_request.yaml"
)
POP_SERVICE_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"janus_live_request.yaml"
)
POP_SERVICE
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/janus_live_data"
,
"pop_service.yaml"
)
POP_SERVICE
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/janus_live_data"
,
"pop_service.yaml"
)
#OM后台-弹出美券
POP_GIFT_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"janus_live_request.yaml"
)
POP_GIFT
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/janus_live_data"
,
"pop_gift.yaml"
)
#用户-领取美券
GET_GIFT_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"janus_live_request.yaml"
)
GET_GIFT
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/janus_live_data"
,
"get_gift.yaml"
)
#主播-推荐袋删除商品
#主播-推荐袋删除商品
DELETELIVESERVICE_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"janus_live_request.yaml"
)
DELETELIVESERVICE_CONFIG
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/all_backend_api"
,
"janus_live_request.yaml"
)
DELETELIVESERVICE
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/janus_live_data"
,
"delete_live_service.yaml"
)
DELETELIVESERVICE
=
os
.
path
.
join
(
BASE_DIR
,
"backend_auto/test_backend_data/janus_live_data"
,
"delete_live_service.yaml"
)
...
...
test_backend_case/janus_live_case/test_get_gift.py
0 → 100644
View file @
491f1609
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
TestGetGift
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
GET_GIFT
)
get_gift_case
,
get_gift_data
=
get_ids
(
data
,
"get_gift"
)
@pytest.mark.parametrize
(
"param"
,
get_gift_data
,
ids
=
get_gift_case
)
def
test_get_gift
(
self
,
param
):
r
=
live_request
()
.
get_gift
(
param
[
"gift_id"
],
param
[
"version"
])
if
r
[
"message"
]
==
"领取成功!"
:
print
(
"用户成功领取美券~"
)
assert
r
[
"data"
][
"has_gift_left"
]
==
param
[
"assert"
]
else
:
print
(
"出错了!!!"
)
\ No newline at end of file
test_backend_case/janus_live_case/test_pop_gift.py
0 → 100644
View file @
491f1609
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
TestPopGift
:
data
=
BaseRequest
()
.
api_load
(
path_setting
.
POP_GIFT
)
pop_gift_case
,
pop_gift_data
=
get_ids
(
data
,
"pop_gift"
)
@pytest.mark.parametrize
(
"param"
,
pop_gift_data
,
ids
=
pop_gift_case
)
def
test_pop_gift
(
self
,
param
):
r
=
live_request
()
.
pop_gift
(
param
[
"stream_id"
],
param
[
"gift_id"
],
param
[
"version"
])
if
r
[
"data"
]
is
not
None
:
print
(
"成功弹出美券"
)
assert
r
[
"data"
][
"gift_id"
]
==
param
[
"assert"
]
else
:
print
(
"出错了!!!"
)
\ No newline at end of file
test_backend_data/janus_live_data/get_gift.yaml
0 → 100644
View file @
491f1609
get_gift
:
#用户-领取美券
-
case
:
"
用户-领取美券"
gift_id
:
"
59124"
version
:
"
7.46.0"
assert
:
1
\ No newline at end of file
test_backend_data/janus_live_data/pop_gift.yaml
0 → 100644
View file @
491f1609
pop_gift
:
#在om后台添加美券后,点击弹出,直播间弹出美券
-
case
:
"
在om后台添加美券后,点击弹出,直播间弹出美券"
stream_id
:
"
4271"
gift_id
:
"
59124"
version
:
"
7.46.0"
assert
:
59124
\ 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