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


Python ServiceBusService.list_queues方法代码示例

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


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

示例1: ServiceBusTest

# 需要导入模块: from azure.servicebus import ServiceBusService [as 别名]
# 或者: from azure.servicebus.ServiceBusService import list_queues [as 别名]

#.........这里部分代码省略.........
        self.assertFalse(created2)

    def test_create_queue_with_already_existing_queue_fail_on_exist(self):
        # Arrange

        # Act
        created = self.sbs.create_queue(self.queue_name)
        with self.assertRaises(WindowsAzureError):
            self.sbs.create_queue(self.queue_name, None, True)

        # Assert
        self.assertTrue(created)

    def test_get_queue_with_existing_queue(self):
        # Arrange
        self._create_queue(self.queue_name)

        # Act
        queue = self.sbs.get_queue(self.queue_name)

        # Assert
        self.assertIsNotNone(queue)
        self.assertEquals(queue.name, self.queue_name)

    def test_get_queue_with_non_existing_queue(self):
        # Arrange

        # Act
        with self.assertRaises(WindowsAzureError):
            resp = self.sbs.get_queue(self.queue_name)

        # Assert

    def test_list_queues(self):
        # Arrange
        self._create_queue(self.queue_name)

        # Act
        queues = self.sbs.list_queues()
        for queue in queues:
            name = queue.name

        # Assert
        self.assertIsNotNone(queues)
        self.assertNamedItemInContainer(queues, self.queue_name)

    def test_list_queues_with_special_chars(self):
        # Arrange
        # Name must start and end with an alphanumeric and can only contain
        # letters, numbers, periods, hyphens, forward slashes and underscores.
        other_queue_name = self.queue_name + 'foo/.-_123'
        self.additional_queue_names = [other_queue_name]
        self._create_queue(other_queue_name)

        # Act
        queues = self.sbs.list_queues()

        # Assert
        self.assertIsNotNone(queues)
        self.assertNamedItemInContainer(queues, other_queue_name)

    def test_delete_queue_with_existing_queue(self):
        # Arrange
        self._create_queue(self.queue_name)

        # Act
开发者ID:slick666,项目名称:azure-sdk-for-python,代码行数:70,代码来源:test_servicebusservice.py

示例2: ServiceBusService

# 需要导入模块: from azure.servicebus import ServiceBusService [as 别名]
# 或者: from azure.servicebus.ServiceBusService import list_queues [as 别名]
from azure.servicebus import ServiceBusService


service_namespace = 'dev-montavo'
account_key = '3me4sCOHDWBK8PkjkznLnFkksQ0H/aWL3FU/JlzF5d0='
sbs = ServiceBusService(service_namespace, account_key, 'owner')
[q.name for q in sbs.list_queues()]
q = sbs.list_queues()[0]
m = sbs.receive_queue_message(q.name)
m.body
m.custom_properties
开发者ID:MudassirMontavo,项目名称:montavobackend,代码行数:13,代码来源:mobile_app_old.py


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