Commit 44969a1f authored by liangfenglong's avatar liangfenglong

更新

parent 51987505
......@@ -31,3 +31,7 @@ GENGMEI_PARAMS = {
# BACKEND_ADMIN = 'https://backend.igengmei.com'
BACKEND_ADMIN = 'http://backend.paas-develop.env'
SEND_MSG_TIME = 6
\ No newline at end of file
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('主播获取弹幕成功!')
import requests
import pytest
from utils.gmhttp import require_login
from .livecase import LiveCase
......@@ -15,6 +16,7 @@ class LiveEnter(LiveCase):
'channel_id': self.channel_id
})
@pytest.mark.get
def test_live_enter_visitor(self):
'''
游客进入直播间
......@@ -23,6 +25,7 @@ class LiveEnter(LiveCase):
self.assertEqual(rep['error'], 0, rep)
print('游客进入直播间成功!')
@pytest.mark.get
@require_login(settings.LIVE_WATCHER)
def test_live_enter_user(self):
'''
......@@ -32,6 +35,7 @@ class LiveEnter(LiveCase):
self.assertEqual(rep['error'], 0, rep)
print('app用户进入直播间成功!')
@pytest.mark.get
@require_login(settings.LIVE_USER)
def test_live_enter_author(self):
'''
......
import requests
import pytest
from utils.gmhttp import require_login
from .livecase import LiveCase
......@@ -17,7 +18,7 @@ class LiveSendMsg(LiveCase):
self.data_warn = {'channel_id': self.channel_id,
'msg': '习近平,该条弹幕应被拦截'
}
@pytest.mark.post
def test_live_sendmsg_visitor(self):
'''
游客发送弹幕
......@@ -26,6 +27,7 @@ class LiveSendMsg(LiveCase):
self.assertEqual(rep['error_code'], 70000, rep)
print('提示游客登录。')
@pytest.mark.post
@require_login(settings.LIVE_WATCHER)
def test_live_sendmsg_user(self):
'''
......@@ -35,6 +37,7 @@ class LiveSendMsg(LiveCase):
self.assertEqual(rep['error'], 1, rep)
print('app用户发送弹幕成功!')
@pytest.mark.post
@require_login(settings.LIVE_USER)
def test_live_sendmsg_author(self):
'''
......@@ -44,6 +47,7 @@ class LiveSendMsg(LiveCase):
self.assertEqual(rep['error'], 0, rep)
print('主播发送弹幕成功!')
@pytest.mark.post
@require_login(settings.LIVE_WATCHER)
def test_live_sendmsg_warn(self):
'''
......@@ -55,6 +59,7 @@ class LiveSendMsg(LiveCase):
self.assertEqual(rep['message'], '您输入的内容包含敏感信息,请重新输入', rep)
print('敏感词拦截成功!')
@pytest.mark.post
@require_login(settings.LIVE_WATCHER)
def test_live_sendmsg_interval(self):
'''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment