本文整理汇总了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",
#.........这里部分代码省略.........