Commit 80ba9cc1 authored by edz's avatar edz

新增轮询接口

parent 53945770
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="PyDocumentationSettings">
<option name="format" value="PLAIN" />
<option name="myDocStringFormat" value="Plain" />
</component>
<component name="TestRunnerService">
<option name="PROJECT_TEST_RUNNER" value="pytest" />
</component>
</module>
\ No newline at end of file
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.6" project-jdk-type="Python SDK" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/AutoApiTest.iml" filepath="$PROJECT_DIR$/.idea/AutoApiTest.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="BranchesTreeState">
<expand>
<path>
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="LOCAL_ROOT" type="e8cecc67:BranchNodeDescriptor" />
</path>
<path>
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="REMOTE_ROOT" type="e8cecc67:BranchNodeDescriptor" />
</path>
<path>
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="REMOTE_ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="GROUP_NODE:origin" type="e8cecc67:BranchNodeDescriptor" />
</path>
</expand>
<select />
</component>
<component name="ChangeListManager">
<list default="true" id="141eb6db-995b-4153-87ad-863d77d8f4a9" name="Default Changelist" comment="" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="Python Script" />
</list>
</option>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="ProjectId" id="1mb0KF7KFmRZbCOQVgjFGnzfW3U" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
<property name="settings.editor.selected.configurable" value="org.jetbrains.plugins.github.ui.GithubSettingsConfigurable" />
</component>
<component name="RunManager" selected="Python tests.pytest for live.test_live_polling.LivePolling.test_live_polling_visitor">
<configuration name="pytest for live.test_live_polling.LivePolling.test_live_polling_visitor" type="tests" factoryName="py.test" temporary="true" nameIsGenerated="true">
<module name="AutoApiTest" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/testCase" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<option name="_new_keywords" value="&quot;&quot;" />
<option name="_new_parameters" value="&quot;&quot;" />
<option name="_new_additionalArguments" value="&quot;&quot;" />
<option name="_new_target" value="&quot;live.test_live_polling.LivePolling.test_live_polling_visitor&quot;" />
<option name="_new_targetType" value="&quot;PYTHON&quot;" />
<method v="2" />
</configuration>
<configuration name="pytest for live.test_live_sendmsg.LiveSendMsg.test_live_sendmsg_visitor" type="tests" factoryName="py.test" temporary="true" nameIsGenerated="true">
<module name="AutoApiTest" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/testCase" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<option name="_new_keywords" value="&quot;&quot;" />
<option name="_new_parameters" value="&quot;&quot;" />
<option name="_new_additionalArguments" value="&quot;&quot;" />
<option name="_new_target" value="&quot;live.test_live_sendmsg.LiveSendMsg.test_live_sendmsg_visitor&quot;" />
<option name="_new_targetType" value="&quot;PYTHON&quot;" />
<method v="2" />
</configuration>
<recent_temporary>
<list>
<item itemvalue="Python tests.pytest for live.test_live_polling.LivePolling.test_live_polling_visitor" />
<item itemvalue="Python tests.pytest for live.test_live_sendmsg.LiveSendMsg.test_live_sendmsg_visitor" />
</list>
</recent_temporary>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="SvnConfiguration">
<configuration>$PROJECT_DIR$/../.subversion</configuration>
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="141eb6db-995b-4153-87ad-863d77d8f4a9" name="Default Changelist" comment="" />
<created>1609746916271</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1609746916271</updated>
</task>
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
<option name="TAB_STATES">
<map>
<entry key="MAIN">
<value>
<State />
</value>
</entry>
</map>
</option>
</component>
<component name="WindowStateProjectService">
<state width="1371" height="373" key="GridCell.Tab.0.bottom" timestamp="1610018868443">
<screen x="0" y="23" width="1402" height="877" />
</state>
<state width="1371" height="373" key="GridCell.Tab.0.bottom/0.23.1402.877/-190.-1057.1920.1057@0.23.1402.877" timestamp="1610018868443" />
<state width="1371" height="373" key="GridCell.Tab.0.bottom/0.23.1403.877/-190.-1057.1920.1057@0.23.1403.877" timestamp="1610002487290" />
<state width="1371" height="373" key="GridCell.Tab.0.center" timestamp="1610018868443">
<screen x="0" y="23" width="1402" height="877" />
</state>
<state width="1371" height="373" key="GridCell.Tab.0.center/0.23.1402.877/-190.-1057.1920.1057@0.23.1402.877" timestamp="1610018868443" />
<state width="1371" height="373" key="GridCell.Tab.0.center/0.23.1403.877/-190.-1057.1920.1057@0.23.1403.877" timestamp="1610002487288" />
<state width="1371" height="373" key="GridCell.Tab.0.left" timestamp="1610018868442">
<screen x="0" y="23" width="1402" height="877" />
</state>
<state width="1371" height="373" key="GridCell.Tab.0.left/0.23.1402.877/-190.-1057.1920.1057@0.23.1402.877" timestamp="1610018868442" />
<state width="1371" height="373" key="GridCell.Tab.0.left/0.23.1403.877/-190.-1057.1920.1057@0.23.1403.877" timestamp="1610002487286" />
<state width="1371" height="373" key="GridCell.Tab.0.right" timestamp="1610018868443">
<screen x="0" y="23" width="1402" height="877" />
</state>
<state width="1371" height="373" key="GridCell.Tab.0.right/0.23.1402.877/-190.-1057.1920.1057@0.23.1402.877" timestamp="1610018868443" />
<state width="1371" height="373" key="GridCell.Tab.0.right/0.23.1403.877/-190.-1057.1920.1057@0.23.1403.877" timestamp="1610002487288" />
<state x="61" y="97" key="SettingsEditor" timestamp="1610016494003">
<screen x="0" y="23" width="1403" height="877" />
</state>
<state x="61" y="97" key="SettingsEditor/0.23.1403.877/-190.-1057.1920.1057@0.23.1403.877" timestamp="1610016494003" />
<state x="61" y="97" key="SettingsEditor/0.23.1404.877/-190.-1057.1920.1057@0.23.1404.877" timestamp="1610012460068" />
</component>
</project>
\ No newline at end of file
import requests
from utils.gmhttp import require_login
from .livecase import LiveCase
from conf import settings
class LivePolling(LiveCase):
def setUp(self):
uri = '/api/janus/live/polling'
self.url = self.host + uri
self.params = dict(settings.GENGMEI_PARAMS, **{
'stream_id': self.stream_id
})
def test_live_polling_visitor(self):
'''
游客直播间轮询接口
'''
rep = requests.get(self.url, params=self.params).json()
self.assertEqual(rep['error'], 0, rep)
print('polling轮询接口执行成功')
@require_login(settings.LIVE_WATCHER)
def test_live_polling_user(self):
'''
用户直播间轮询接口
'''
rep = requests.get(self.url, params=self.params).json()
self.assertEqual(rep['error'], 0, rep)
print('用户polling轮询接口执行成功')
@require_login(settings.LIVE_USER)
def test_live_polling_author(self):
'''
主播直播间轮询接口
'''
rep = requests.get(self.url, params=self.params).json()
self.assertEqual(rep['error'], 0, rep)
print('主播polling轮询接口执行成功')
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