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


Python Iso.update方法代码示例

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


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

示例1: test_03_edit_iso_details

# 需要导入模块: from marvin.lib.base import Iso [as 别名]
# 或者: from marvin.lib.base.Iso import update [as 别名]
    def test_03_edit_iso_details(self):
        """
        @Desc: Test to Edit ISO name, displaytext, OSType
        @steps:
        Step1: Listing all the ISO's for a user
        Step2: Verifying that no ISO's are listed
        Step3: Creating an ISO
        Step4: Listing all the ISO's again for a user
        Step5: Verifying that list size is 1
        Step6: Verifying if the ISO is in ready state.
                If yes the continuing
                If not waiting and checking for template to be ready till timeout
        Step7: Editing the ISO's name, displaytext
        Step8: Verifying that ISO name and displaytext are edited
        Step9: Editing the ISO name, displaytext, ostypeid
        Step10: Verifying that ISO name, displaytext and ostypeid are edited
        """
        # Listing all the ISO's for a User
        list_iso_before = Iso.list(
                                   self.userapiclient,
                                   listall=self.services["listall"],
                                   isofilter=self.services["templatefilter"]
                                   )
        # Verifying that no ISOs are listed
        self.assertIsNone(
                          list_iso_before,
                          "ISOs listed for newly created User"
                          )
        self.services["iso"]["zoneid"] = self.zone.id
        # Creating an ISO's
        iso_created = Iso.create(
                                 self.userapiclient,
                                 self.services["iso"]
                                 )
        self.assertIsNotNone(
                             iso_created,
                             "ISO creation failed"
                             )
        self.cleanup.append(iso_created)
        # Listing all the ISO's for a User
        list_iso_after = Iso.list(
                                  self.userapiclient,
                                  listall=self.services["listall"],
                                  isofilter=self.services["templatefilter"]
                                  )
        status = validateList(list_iso_after)
        self.assertEquals(
                          PASS,
                          status[0],
                          "ISO's creation failed"
                          )
        # Verifying that list size is 1
        self.assertEquals(
                          1,
                          len(list_iso_after),
                          "Failed to create an ISO's"
                          )
        # Verifying the state of the ISO to be ready. If not waiting for state to become ready
        iso_ready = False
        count = 0
        while iso_ready is False:
            list_iso = Iso.list(
                                self.userapiclient,
                                listall=self.services["listall"],
                                isofilter=self.services["templatefilter"],
                                id=iso_created.id
                                )
            status = validateList(list_iso)
            self.assertEquals(
                              PASS,
                              status[0],
                              "Failed to list ISO by Id"
                              )
            if list_iso[0].isready is True:
                iso_ready = True
            elif (str(list_iso[0].status) == "Error"):
                self.fail("Created ISO is in Errored state")
                break
            elif count > 10:
                self.fail("Timed out before ISO came into ready state")
                break
            else:
                time.sleep(self.services["sleep"])
                count = count + 1

        # Editing the ISO name, displaytext
        edited_iso = Iso.update(
                                iso_created,
                                self.userapiclient,
                                name="NewISOName",
                                displaytext="NewISODisplayText"
                                )
        self.assertIsNotNone(
                             edited_iso,
                             "Editing ISO failed"
                             )
         # Verifying the details of edited template
        expected_dict = {
                         "id":iso_created.id,
                         "name":"NewISOName",
#.........这里部分代码省略.........
开发者ID:fengyueyugu,项目名称:cloudstack,代码行数:103,代码来源:test_escalations_isos.py


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