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
44969a1f
Commit
44969a1f
authored
Jan 07, 2021
by
liangfenglong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
51987505
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
1 deletion
+58
-1
settings.py
conf/settings.py
+5
-0
test_live_danmu_v2.py
testCase/live/test_live_danmu_v2.py
+43
-0
test_live_enter.py
testCase/live/test_live_enter.py
+4
-0
test_live_sendmsg.py
testCase/live/test_live_sendmsg.py
+6
-1
No files found.
conf/settings.py
View file @
44969a1f
...
@@ -31,3 +31,7 @@ GENGMEI_PARAMS = {
...
@@ -31,3 +31,7 @@ GENGMEI_PARAMS = {
# BACKEND_ADMIN = 'https://backend.igengmei.com'
# BACKEND_ADMIN = 'https://backend.igengmei.com'
BACKEND_ADMIN
=
'http://backend.paas-develop.env'
BACKEND_ADMIN
=
'http://backend.paas-develop.env'
SEND_MSG_TIME
=
6
\ No newline at end of file
testCase/live/test_live_danmu_v2.py
0 → 100644
View file @
44969a1f
import
requests
from
utils.gmhttp
import
require_login
from
.livecase
import
LiveCase
from
conf
import
settings
class
LiveDanmuV2
(
LiveCase
):
'''获取弹幕'''
# 回放的弹幕,正在直播的弹幕没有逻辑上的区别
def
setUp
(
self
):
uri
=
'/api/live/danmu_v2'
self
.
url
=
self
.
host
+
uri
self
.
params
=
dict
(
settings
.
GENGMEI_PARAMS
,
**
{
'channel_id'
:
self
.
channel_id
})
def
test_live_danmu_v2
(
self
):
'''
游客获取弹幕
'''
rep
=
requests
.
get
(
self
.
url
,
params
=
self
.
params
)
.
json
()
self
.
assertEqual
(
rep
[
'error'
],
0
,
rep
)
print
(
'游客获取弹幕成功!'
)
@require_login
(
settings
.
LIVE_WATCHER
)
def
test_live_enter_user
(
self
):
'''
app用户获取弹幕
'''
rep
=
requests
.
get
(
self
.
url
,
params
=
self
.
params
)
.
json
()
self
.
assertEqual
(
rep
[
'error'
],
0
,
rep
)
print
(
'app用户获取弹幕成功!'
)
@require_login
(
settings
.
LIVE_USER
)
def
test_live_enter_author
(
self
):
'''
主播获取弹幕
'''
rep
=
requests
.
get
(
self
.
url
,
params
=
self
.
params
)
.
json
()
self
.
assertEqual
(
rep
[
'error'
],
0
,
rep
)
print
(
'主播获取弹幕成功!'
)
testCase/live/test_live_enter.py
View file @
44969a1f
import
requests
import
requests
import
pytest
from
utils.gmhttp
import
require_login
from
utils.gmhttp
import
require_login
from
.livecase
import
LiveCase
from
.livecase
import
LiveCase
...
@@ -15,6 +16,7 @@ class LiveEnter(LiveCase):
...
@@ -15,6 +16,7 @@ class LiveEnter(LiveCase):
'channel_id'
:
self
.
channel_id
'channel_id'
:
self
.
channel_id
})
})
@pytest.mark.get
def
test_live_enter_visitor
(
self
):
def
test_live_enter_visitor
(
self
):
'''
'''
游客进入直播间
游客进入直播间
...
@@ -23,6 +25,7 @@ class LiveEnter(LiveCase):
...
@@ -23,6 +25,7 @@ class LiveEnter(LiveCase):
self
.
assertEqual
(
rep
[
'error'
],
0
,
rep
)
self
.
assertEqual
(
rep
[
'error'
],
0
,
rep
)
print
(
'游客进入直播间成功!'
)
print
(
'游客进入直播间成功!'
)
@pytest.mark.get
@require_login
(
settings
.
LIVE_WATCHER
)
@require_login
(
settings
.
LIVE_WATCHER
)
def
test_live_enter_user
(
self
):
def
test_live_enter_user
(
self
):
'''
'''
...
@@ -32,6 +35,7 @@ class LiveEnter(LiveCase):
...
@@ -32,6 +35,7 @@ class LiveEnter(LiveCase):
self
.
assertEqual
(
rep
[
'error'
],
0
,
rep
)
self
.
assertEqual
(
rep
[
'error'
],
0
,
rep
)
print
(
'app用户进入直播间成功!'
)
print
(
'app用户进入直播间成功!'
)
@pytest.mark.get
@require_login
(
settings
.
LIVE_USER
)
@require_login
(
settings
.
LIVE_USER
)
def
test_live_enter_author
(
self
):
def
test_live_enter_author
(
self
):
'''
'''
...
...
testCase/live/test_live_sendmsg.py
View file @
44969a1f
import
requests
import
requests
import
pytest
from
utils.gmhttp
import
require_login
from
utils.gmhttp
import
require_login
from
.livecase
import
LiveCase
from
.livecase
import
LiveCase
...
@@ -17,7 +18,7 @@ class LiveSendMsg(LiveCase):
...
@@ -17,7 +18,7 @@ class LiveSendMsg(LiveCase):
self
.
data_warn
=
{
'channel_id'
:
self
.
channel_id
,
self
.
data_warn
=
{
'channel_id'
:
self
.
channel_id
,
'msg'
:
'习近平,该条弹幕应被拦截'
'msg'
:
'习近平,该条弹幕应被拦截'
}
}
@pytest.mark.post
def
test_live_sendmsg_visitor
(
self
):
def
test_live_sendmsg_visitor
(
self
):
'''
'''
游客发送弹幕
游客发送弹幕
...
@@ -26,6 +27,7 @@ class LiveSendMsg(LiveCase):
...
@@ -26,6 +27,7 @@ class LiveSendMsg(LiveCase):
self
.
assertEqual
(
rep
[
'error_code'
],
70000
,
rep
)
self
.
assertEqual
(
rep
[
'error_code'
],
70000
,
rep
)
print
(
'提示游客登录。'
)
print
(
'提示游客登录。'
)
@pytest.mark.post
@require_login
(
settings
.
LIVE_WATCHER
)
@require_login
(
settings
.
LIVE_WATCHER
)
def
test_live_sendmsg_user
(
self
):
def
test_live_sendmsg_user
(
self
):
'''
'''
...
@@ -35,6 +37,7 @@ class LiveSendMsg(LiveCase):
...
@@ -35,6 +37,7 @@ class LiveSendMsg(LiveCase):
self
.
assertEqual
(
rep
[
'error'
],
1
,
rep
)
self
.
assertEqual
(
rep
[
'error'
],
1
,
rep
)
print
(
'app用户发送弹幕成功!'
)
print
(
'app用户发送弹幕成功!'
)
@pytest.mark.post
@require_login
(
settings
.
LIVE_USER
)
@require_login
(
settings
.
LIVE_USER
)
def
test_live_sendmsg_author
(
self
):
def
test_live_sendmsg_author
(
self
):
'''
'''
...
@@ -44,6 +47,7 @@ class LiveSendMsg(LiveCase):
...
@@ -44,6 +47,7 @@ class LiveSendMsg(LiveCase):
self
.
assertEqual
(
rep
[
'error'
],
0
,
rep
)
self
.
assertEqual
(
rep
[
'error'
],
0
,
rep
)
print
(
'主播发送弹幕成功!'
)
print
(
'主播发送弹幕成功!'
)
@pytest.mark.post
@require_login
(
settings
.
LIVE_WATCHER
)
@require_login
(
settings
.
LIVE_WATCHER
)
def
test_live_sendmsg_warn
(
self
):
def
test_live_sendmsg_warn
(
self
):
'''
'''
...
@@ -55,6 +59,7 @@ class LiveSendMsg(LiveCase):
...
@@ -55,6 +59,7 @@ class LiveSendMsg(LiveCase):
self
.
assertEqual
(
rep
[
'message'
],
'您输入的内容包含敏感信息,请重新输入'
,
rep
)
self
.
assertEqual
(
rep
[
'message'
],
'您输入的内容包含敏感信息,请重新输入'
,
rep
)
print
(
'敏感词拦截成功!'
)
print
(
'敏感词拦截成功!'
)
@pytest.mark.post
@require_login
(
settings
.
LIVE_WATCHER
)
@require_login
(
settings
.
LIVE_WATCHER
)
def
test_live_sendmsg_interval
(
self
):
def
test_live_sendmsg_interval
(
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