当前位置: 首页>>代码示例>>Python>>正文


Python AMQPWriter.write_longlong方法代码示例

本文整理汇总了Python中amqp.serialization.AMQPWriter.write_longlong方法的典型用法代码示例。如果您正苦于以下问题:Python AMQPWriter.write_longlong方法的具体用法?Python AMQPWriter.write_longlong怎么用?Python AMQPWriter.write_longlong使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在amqp.serialization.AMQPWriter的用法示例。


在下文中一共展示了AMQPWriter.write_longlong方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_longlong

# 需要导入模块: from amqp.serialization import AMQPWriter [as 别名]
# 或者: from amqp.serialization.AMQPWriter import write_longlong [as 别名]
    def test_longlong(self):
        for i in range(256):
            val = randint(0, (2 ** 64) - 1)
            w = AMQPWriter()
            w.write_longlong(val)
            s = w.getvalue()

            r = AMQPReader(s)
            self.assertEqual(r.read_longlong(), val)
开发者ID:UCSB-CS-RACELab,项目名称:CloudRunner,代码行数:11,代码来源:test_serialization.py

示例2: test_Channel

# 需要导入模块: from amqp.serialization import AMQPWriter [as 别名]
# 或者: from amqp.serialization.AMQPWriter import write_longlong [as 别名]
class test_Channel(Case):

    def setUp(self):
        self.args = AMQPWriter()
        self.connection = Mock(name='connection')
        self.connection.channels = defaultdict(lambda: None)
        self.channel = NoOpenChannel(self.connection, channel_id=1)

    def test_basic_nack(self, delivery_tag=3172312312):
        self.args.write_longlong(delivery_tag)
        self.args.write_bit(0)
        self.args.write_bit(0)
        with self.assertRaises(NotConfirmed):
            self.channel._basic_nack(AMQPReader(self.args.getvalue()))
        callback = Mock(name='callback')
        self.channel.events['basic_nack'].add(callback)
        self.channel._basic_nack(AMQPReader(self.args.getvalue()))
        callback.assert_called_with(delivery_tag, False, False)
开发者ID:1995rishi,项目名称:flaskmap,代码行数:20,代码来源:test_channel.py


注:本文中的amqp.serialization.AMQPWriter.write_longlong方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。