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


Python test.attr方法代码示例

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


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

示例1: test_backend_name_distinction

# 需要导入模块: from tempest import test [as 别名]
# 或者: from tempest.test import attr [as 别名]
def test_backend_name_distinction(self):
        # this test checks that the two volumes created at setUp don't
        # belong to the same backend (if they are, than the
        # volume backend distinction is not working properly)
        if self.backend1_name == self.backend2_name:
            raise self.skipException("backends configured with same name")

        resp, volume = self.volume_client.get_volume(self.volume1['id'])
        volume1_host = volume['os-vol-host-attr:host']

        resp, volume = self.volume_client.get_volume(self.volume2['id'])
        volume2_host = volume['os-vol-host-attr:host']

        msg = ("volumes %s and %s were created in the same backend" %
               (self.volume1['id'], self.volume2['id']))
        self.assertNotEqual(volume1_host, volume2_host, msg) 
开发者ID:LIS,项目名称:LIS-Tempest,代码行数:18,代码来源:test_multi_backend.py

示例2: test_backend_name_reporting

# 需要导入模块: from tempest import test [as 别名]
# 或者: from tempest.test import attr [as 别名]
def test_backend_name_reporting(self):
        # this test checks if os-vol-attr:host is populated correctly after
        # the multi backend feature has been enabled
        # if multi-backend is enabled: os-vol-attr:host should be like:
        # [email protected]_name
        resp, volume = self.volume_client.get_volume(self.volume1['id'])
        self.assertEqual(200, resp.status)

        volume1_host = volume['os-vol-host-attr:host']
        msg = ("multi-backend reporting incorrect values for volume %s" %
               self.volume1['id'])
        self.assertTrue(len(volume1_host.split("@")) > 1, msg) 
开发者ID:LIS,项目名称:LIS-Tempest,代码行数:14,代码来源:test_multi_backend.py


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