本文整理汇总了Python中stompest.sync.Stomp._transportFactory方法的典型用法代码示例。如果您正苦于以下问题:Python Stomp._transportFactory方法的具体用法?Python Stomp._transportFactory怎么用?Python Stomp._transportFactory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stompest.sync.Stomp
的用法示例。
在下文中一共展示了Stomp._transportFactory方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _get_timeouting_connect_mock
# 需要导入模块: from stompest.sync import Stomp [as 别名]
# 或者: from stompest.sync.Stomp import _transportFactory [as 别名]
def _get_timeouting_connect_mock(self):
stomp = Stomp(CONFIG)
stomp._transportFactory = mock.Mock()
transport = stomp._transportFactory.return_value = mock.Mock()
transport.host = 'mock'
transport.port = 0
transport.canRead.return_value = False
return stomp
示例2: _get_connect_mock
# 需要导入模块: from stompest.sync import Stomp [as 别名]
# 或者: from stompest.sync.Stomp import _transportFactory [as 别名]
def _get_connect_mock(self, receive=None, config=None):
stomp = Stomp(config or CONFIG)
stomp._transportFactory = Mock()
transport = stomp._transportFactory.return_value = Mock()
transport.host = 'mock'
transport.port = 0
if receive:
transport.receive.return_value = receive
return stomp