當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。