本文整理汇总了Python中azure.servicebus.ServiceBusService.list_topics方法的典型用法代码示例。如果您正苦于以下问题:Python ServiceBusService.list_topics方法的具体用法?Python ServiceBusService.list_topics怎么用?Python ServiceBusService.list_topics使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类azure.servicebus.ServiceBusService
的用法示例。
在下文中一共展示了ServiceBusService.list_topics方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ServiceBusTest
# 需要导入模块: from azure.servicebus import ServiceBusService [as 别名]
# 或者: from azure.servicebus.ServiceBusService import list_topics [as 别名]
#.........这里部分代码省略.........
# Act
val = topic_options.max_size_in_mega_bytes
# Assert
self.assertEqual(val, 5120)
# Act
topic_options.max_size_in_mega_bytes = 1024
# Assert
self.assertEqual(topic_options.max_size_in_megabytes, 1024)
def test_get_topic_with_existing_topic(self):
# Arrange
self._create_topic(self.topic_name)
# Act
topic = self.sbs.get_topic(self.topic_name)
# Assert
self.assertIsNotNone(topic)
self.assertEquals(topic.name, self.topic_name)
def test_get_topic_with_non_existing_topic(self):
# Arrange
# Act
with self.assertRaises(WindowsAzureError):
self.sbs.get_topic(self.topic_name)
# Assert
def test_list_topics(self):
# Arrange
self._create_topic(self.topic_name)
# Act
topics = self.sbs.list_topics()
for topic in topics:
name = topic.name
# Assert
self.assertIsNotNone(topics)
self.assertNamedItemInContainer(topics, self.topic_name)
def test_list_topics_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_topic_name = self.topic_name + 'foo/.-_123'
self.additional_topic_names = [other_topic_name]
self._create_topic(other_topic_name)
# Act
topics = self.sbs.list_topics()
# Assert
self.assertIsNotNone(topics)
self.assertNamedItemInContainer(topics, other_topic_name)
def test_delete_topic_with_existing_topic(self):
# Arrange
self._create_topic(self.topic_name)
# Act