Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
A
AutoApiTest
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
business
AutoApiTest
Commits
b28576ea
Commit
b28576ea
authored
Jan 08, 2021
by
liangfenglong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
53945770
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
0 deletions
+69
-0
test_live_beauty.py
testCase/live/test_live_beauty.py
+69
-0
No files found.
testCase/live/test_live_beauty.py
0 → 100644
View file @
b28576ea
import
requests
import
pytest
from
utils.gmhttp
import
require_login
from
.livecase
import
LiveCase
from
conf
import
settings
class
LiveBeauty
(
LiveCase
):
'''主播获取+设置相机美颜'''
def
setUp
(
self
):
uri
=
'/api/janus/live/beauty'
self
.
url
=
self
.
host
+
uri
self
.
params
=
dict
(
settings
.
GENGMEI_PARAMS
,
**
{
'channel_id'
:
self
.
channel_id
})
@require_login
(
settings
.
LIVE_USER
)
def
_live_beauty
(
self
):
'''
主播获取相机美颜设置
'''
rep
=
requests
.
get
(
self
.
url
,
params
=
self
.
params
)
.
json
()
return
rep
@pytest.mark.get
@require_login
(
settings
.
LIVE_USER
)
def
test_live_beauty
(
self
):
'''
主播获取相机美颜设置
'''
rep
=
self
.
_live_beauty
()
self
.
assertEqual
(
rep
[
'error'
],
0
,
rep
)
self
.
assertIn
(
rep
[
'data'
][
'is_open'
],
(
0
,
1
),
rep
)
self
.
assertGreaterEqual
(
rep
[
'data'
][
'smooth'
],
0
,
rep
)
self
.
assertLessEqual
(
rep
[
'data'
][
'smooth'
],
1
,
rep
)
self
.
assertGreaterEqual
(
rep
[
'data'
][
'white'
],
0
,
rep
)
self
.
assertLessEqual
(
rep
[
'data'
][
'white'
],
1
,
rep
)
self
.
assertGreaterEqual
(
rep
[
'data'
][
'rosy'
],
0
,
rep
)
self
.
assertLessEqual
(
rep
[
'data'
][
'rosy'
],
1
,
rep
)
print
(
'主播获取相机美颜设置成功!'
)
@pytest.mark.post
@require_login
(
settings
.
LIVE_USER
)
def
test_live_beauty
(
self
):
'''
主播设置相机美颜设置
'''
import
random
is_open
,
rosy
,
smooth
,
white
=
random
.
choice
((
0
,
1
)),
round
(
random
.
random
(),
2
),
\
round
(
random
.
random
(),
2
),
round
(
random
.
random
(),
2
)
data
=
{
"channel_id"
:
self
.
channel_id
,
"is_open"
:
is_open
,
"rosy"
:
rosy
,
"smooth"
:
smooth
,
"white"
:
white
}
rep
=
requests
.
post
(
self
.
url
,
data
=
data
)
.
json
()
self
.
assertEqual
(
rep
[
'error'
],
0
,
rep
)
print
(
'主播设置相机美颜设置成功!'
)
n_rep
=
self
.
_live_beauty
()
self
.
assertEqual
(
n_rep
[
'data'
][
'is_open'
],
is_open
,
rep
)
self
.
assertEqual
(
n_rep
[
'data'
][
'smooth'
],
smooth
,
rep
)
self
.
assertEqual
(
n_rep
[
'data'
][
'white'
],
white
,
rep
)
self
.
assertEqual
(
n_rep
[
'data'
][
'rosy'
],
rosy
,
rep
)
print
(
'主播校验相机美颜设置成功!'
)
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