本文整理汇总了Python中qpid.messaging.Connection.connect方法的典型用法代码示例。如果您正苦于以下问题:Python Connection.connect方法的具体用法?Python Connection.connect怎么用?Python Connection.connect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qpid.messaging.Connection
的用法示例。
在下文中一共展示了Connection.connect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: SetupTests
# 需要导入模块: from qpid.messaging import Connection [as 别名]
# 或者: from qpid.messaging.Connection import connect [as 别名]
class SetupTests(Base):
def testOpen(self):
# XXX: need to flesh out URL support/syntax
self.conn = Connection.open(self.broker.host, self.broker.port,
reconnect=self.reconnect())
self.ping(self.conn.session())
def testConnect(self):
# XXX: need to flesh out URL support/syntax
self.conn = Connection(self.broker.host, self.broker.port,
reconnect=self.reconnect())
self.conn.connect()
self.ping(self.conn.session())
def testConnectError(self):
try:
self.conn = Connection.open("localhost", 0)
assert False, "connect succeeded"
except ConnectError, e:
# XXX: should verify that e includes appropriate diagnostic info
pass