本文整理匯總了Python中robottelo.cli.contenthost.ContentHost.update方法的典型用法代碼示例。如果您正苦於以下問題:Python ContentHost.update方法的具體用法?Python ContentHost.update怎麽用?Python ContentHost.update使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類robottelo.cli.contenthost.ContentHost
的用法示例。
在下文中一共展示了ContentHost.update方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_positive_update_1
# 需要導入模塊: from robottelo.cli.contenthost import ContentHost [as 別名]
# 或者: from robottelo.cli.contenthost.ContentHost import update [as 別名]
def test_positive_update_1(self, test_data):
"""@Test: Check if content host name can be updated
@Feature: Content Hosts
@Assert: Content host is created and name is updated
"""
new_system = None
try:
new_system = make_content_host({
u'organization-id': self.NEW_ORG['id'],
u'content-view-id': self.DEFAULT_CV['id'],
u'lifecycle-environment-id': self.LIBRARY['id']})
except CLIFactoryError as err:
self.fail(err)
# Assert that name does not matches data passed
self.assertNotEqual(
new_system['name'],
test_data['name'],
"Names should not match"
)
# Update system group
result = ContentHost.update({
u'id': new_system['id'],
u'name': test_data['name']})
self.assertEqual(
result.return_code,
0,
"Content host was not updated")
self.assertEqual(
len(result.stderr), 0, "No error was expected")
# Fetch it
result = ContentHost.info({
u'id': new_system['id']})
self.assertEqual(
result.return_code,
0,
"Content host was not updated")
self.assertEqual(
len(result.stderr), 0, "No error was expected")
# Assert that name matches new value
self.assertIsNotNone(
result.stdout.get('name', None),
"The name field was not returned"
)
self.assertEqual(
result.stdout['name'],
test_data['name'],
"Names should match"
)
# Assert that name does not match original value
self.assertNotEqual(
new_system['name'],
result.stdout['name'],
"Names should not match"
)
示例2: test_positive_update_2
# 需要導入模塊: from robottelo.cli.contenthost import ContentHost [as 別名]
# 或者: from robottelo.cli.contenthost.ContentHost import update [as 別名]
def test_positive_update_2(self, test_data):
"""@Test: Check if content host description can be updated
@Feature: Content Hosts
@Assert: Content host is created and description is updated
@BZ: 1082157
"""
new_system = make_content_host({
u'organization-id': self.NEW_ORG['id'],
u'content-view-id': self.DEFAULT_CV['id'],
u'lifecycle-environment-id': self.LIBRARY['id']})
# Assert that description does not match data passed
self.assertNotEqual(
new_system['description'],
test_data['description'],
"Descriptions should not match"
)
# Update sync plan
result = ContentHost.update({
u'id': new_system['id'],
u'description': test_data['description']})
self.assertEqual(
result.return_code,
0,
"Content host was not updated")
self.assertEqual(
len(result.stderr), 0, "No error was expected")
# Fetch it
result = ContentHost.info({
u'id': new_system['id']})
self.assertEqual(
result.return_code,
0,
"Content host was not updated")
self.assertEqual(
len(result.stderr), 0, "No error was expected")
# Assert that description matches new value
self.assertIsNotNone(
result.stdout.get('description', None),
"The description field was not returned"
)
self.assertEqual(
result.stdout['description'],
test_data['description'],
"Descriptions should match"
)
# Assert that description does not matches original value
self.assertNotEqual(
new_system['description'],
result.stdout['description'],
"Descriptions should not match"
)
示例3: test_positive_update_description
# 需要導入模塊: from robottelo.cli.contenthost import ContentHost [as 別名]
# 或者: from robottelo.cli.contenthost.ContentHost import update [as 別名]
def test_positive_update_description(self):
"""Check if content host description can be updated
@Feature: Content Hosts
@Assert: Content host is created and description is updated
"""
new_system = make_content_host(
{
u"content-view-id": self.DEFAULT_CV["id"],
u"lifecycle-environment-id": self.LIBRARY["id"],
u"organization-id": self.NEW_ORG["id"],
}
)
for new_desc in generate_strings_list():
with self.subTest(new_desc):
ContentHost.update({u"id": new_system["id"], u"description": new_desc})
result = ContentHost.info({"id": new_system["id"]})
self.assertEqual(result["description"], new_desc)
示例4: test_positive_update_name
# 需要導入模塊: from robottelo.cli.contenthost import ContentHost [as 別名]
# 或者: from robottelo.cli.contenthost.ContentHost import update [as 別名]
def test_positive_update_name(self):
"""Check if content host name can be updated
@Feature: Content Hosts
@Assert: Content host is created and name is updated
"""
new_system = make_content_host({
u'content-view-id': self.DEFAULT_CV['id'],
u'lifecycle-environment-id': self.LIBRARY['id'],
u'organization-id': self.NEW_ORG['id'],
})
for new_name in generate_strings_list():
with self.subTest(new_name):
ContentHost.update({
u'id': new_system['id'],
u'name': new_name,
})
result = ContentHost.info({'id': new_system['id']})
self.assertEqual(result['name'], new_name)
示例5: test_positive_update_name
# 需要導入模塊: from robottelo.cli.contenthost import ContentHost [as 別名]
# 或者: from robottelo.cli.contenthost.ContentHost import update [as 別名]
def test_positive_update_name(self):
"""Check if content host name can be updated
@id: 056fff14-e9ea-407e-8340-1d5b5da1e4e4
@Assert: Content host is created and name is updated
@BZ: 1318686, 1338780
"""
new_system = make_content_host({
u'content-view-id': self.DEFAULT_CV['id'],
u'lifecycle-environment-id': self.LIBRARY['id'],
u'organization-id': self.NEW_ORG['id'],
})
for new_name in valid_hosts_list():
with self.subTest(new_name):
ContentHost.update({
u'id': new_system['id'],
u'new-name': new_name,
})
result = ContentHost.info({'id': new_system['id']})
self.assertEqual(result['name'], new_name)