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
3c4b6a37
Commit
3c4b6a37
authored
Jan 04, 2021
by
liangfenglong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
a92940e9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
10 deletions
+27
-10
livecase.py
testCase/live/livecase.py
+25
-8
test_case.py
testCase/live/test_case.py
+2
-2
No files found.
testCase/live/livecase.py
View file @
3c4b6a37
import
unittest
import
unittest
import
requests
import
requests
from
conf
import
settings
from
utils.gmhttp
import
require_login
from
utils.gmhttp
import
require_login
class
LiveCase
(
unittest
.
TestCase
):
class
LiveCase
(
unittest
.
TestCase
):
live_id
=
None
@classmethod
@classmethod
def
setUpClass
(
cls
):
def
setUpClass
(
cls
):
...
@@ -17,6 +18,9 @@ class LiveCase(unittest.TestCase):
...
@@ -17,6 +18,9 @@ class LiveCase(unittest.TestCase):
'''
'''
cls
.
create_live
()
cls
.
create_live
()
@classmethod
def
tearDownClass
(
cls
):
cls
.
close_live
()
@classmethod
@classmethod
@require_login
@require_login
...
@@ -25,9 +29,20 @@ class LiveCase(unittest.TestCase):
...
@@ -25,9 +29,20 @@ class LiveCase(unittest.TestCase):
创建直播间
创建直播间
:return:
:return:
'''
'''
r
=
requests
.
post
(
'xxx'
)
.
json
()
uri
=
'/api/live/push_live_info'
url
=
settings
.
BACKEND_ADMIN
+
uri
cls
.
live_id
=
r
[
''
]
params
=
settings
.
GENGMEI_PARAMS
.
update
(
{
'notice'
:
'哈哈哈哈'
,
'tag_id'
:
3161
,
'title'
:
'测试'
,
'cover_url'
:
'2021/01/04/1506/ba72d863e638'
,
'device_type'
:
1
}
)
r
=
requests
.
get
(
url
,
params
=
params
)
.
json
()
cls
.
live_id
=
r
[
'data'
][
'channel'
]
@classmethod
@classmethod
@require_login
@require_login
...
@@ -36,6 +51,9 @@ class LiveCase(unittest.TestCase):
...
@@ -36,6 +51,9 @@ class LiveCase(unittest.TestCase):
关闭直播间
关闭直播间
:return:
:return:
'''
'''
r
=
requests
.
post
(
'xxx'
)
.
json
()
uri
=
'/api/live/finish'
url
=
settings
.
BACKEND_ADMIN
+
uri
print
(
'关闭直播间成功!'
)
data
=
{
'channel_id'
:
cls
.
live_id
}
\ No newline at end of file
r
=
requests
.
post
(
url
,
data
=
data
)
.
json
()
if
r
[
'error'
]
==
0
:
print
(
'关闭直播间成功!'
)
testCase/live/test_case.py
View file @
3c4b6a37
import
unittest
import
requests
import
requests
from
utils.gmhttp
import
require_login
from
utils.gmhttp
import
require_login
from
.livecase
import
LiveCase
class
LiveXXX
(
unittest
.
Test
Case
):
class
LiveXXX
(
Live
Case
):
@require_login
@require_login
def
test_xxx
(
self
):
def
test_xxx
(
self
):
...
...
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