本文整理汇总了Python中gstswitch.controller.Controller.new_record方法的典型用法代码示例。如果您正苦于以下问题:Python Controller.new_record方法的具体用法?Python Controller.new_record怎么用?Python Controller.new_record使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gstswitch.controller.Controller
的用法示例。
在下文中一共展示了Controller.new_record方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_unpack
# 需要导入模块: from gstswitch.controller import Controller [as 别名]
# 或者: from gstswitch.controller.Controller import new_record [as 别名]
def test_unpack(self):
"""Test if unpack fails"""
controller = Controller(address='unix:abstract=abcde')
controller.establish_connection = Mock(return_value=None)
controller.connection = MockConnection(True)
with pytest.raises(ConnectionReturnError):
controller.new_record()
示例2: new_record
# 需要导入模块: from gstswitch.controller import Controller [as 别名]
# 或者: from gstswitch.controller.Controller import new_record [as 别名]
def new_record(self):
"""Create a Controller object and call new_record method"""
res = []
controller = Controller()
for _ in range(self.NUM * self.FACTOR):
res.append(controller.new_record())
return res
示例3: test_action_fails
# 需要导入模块: from gstswitch.controller import Controller [as 别名]
# 或者: from gstswitch.controller.Controller import new_record [as 别名]
def test_action_fails(self):
"""Test what happens if the requested action fails"""
controller = Controller(address='unix:abstract=abcde')
controller.establish_connection = Mock(return_value=None)
controller.connection = MockConnection(
return_variant=True, should_fail=True)
assert controller.new_record() is False
示例4: test_normal_unpack
# 需要导入模块: from gstswitch.controller import Controller [as 别名]
# 或者: from gstswitch.controller.Controller import new_record [as 别名]
def test_normal_unpack(self):
"""Test if valid"""
controller = Controller(address='unix:abstract=abcdef')
controller.establish_connection = Mock(return_value=None)
controller.connection = MockConnection(False)
assert controller.new_record() is True