本文整理汇总了Python中pyon.net.transport.AMQPTransport.close方法的典型用法代码示例。如果您正苦于以下问题:Python AMQPTransport.close方法的具体用法?Python AMQPTransport.close怎么用?Python AMQPTransport.close使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyon.net.transport.AMQPTransport
的用法示例。
在下文中一共展示了AMQPTransport.close方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_close_while_locked
# 需要导入模块: from pyon.net.transport import AMQPTransport [as 别名]
# 或者: from pyon.net.transport.AMQPTransport import close [as 别名]
def test_close_while_locked(self):
tp = AMQPTransport(Mock())
tp.lock = True
tp.close()
self.assertEquals(tp._client.close.call_count, 0)
self.assertEquals(tp._client.callbacks.remove.call_count, 0)
示例2: test_close
# 需要导入模块: from pyon.net.transport import AMQPTransport [as 别名]
# 或者: from pyon.net.transport.AMQPTransport import close [as 别名]
def test_close(self):
client = Mock()
tp = AMQPTransport(client)
tp.close()
client.close.assert_called_once_with()
self.assertEquals(client.callbacks.remove.call_count, 4)
self.assertEquals(client.callbacks.remove.call_args_list, [call(client.channel_number, 'Basic.GetEmpty'),
call(client.channel_number, 'Channel.Close'),
call(client.channel_number, '_on_basic_deliver'),
call(client.channel_number, '_on_basic_get')])
示例3: test_close
# 需要导入模块: from pyon.net.transport import AMQPTransport [as 别名]
# 或者: from pyon.net.transport.AMQPTransport import close [as 别名]
def test_close(self):
client = Mock()
tp = AMQPTransport(client)
tp.close()
client.close.assert_called_once_with()