本文整理汇总了Python中robottelo.cli.hostcollection.HostCollection.delete方法的典型用法代码示例。如果您正苦于以下问题:Python HostCollection.delete方法的具体用法?Python HostCollection.delete怎么用?Python HostCollection.delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类robottelo.cli.hostcollection.HostCollection
的用法示例。
在下文中一共展示了HostCollection.delete方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_positive_delete_by_name
# 需要导入模块: from robottelo.cli.hostcollection import HostCollection [as 别名]
# 或者: from robottelo.cli.hostcollection.HostCollection import delete [as 别名]
def test_positive_delete_by_name(self):
"""Check if host collection can be created and deleted by name
:id: a841a9f8-4285-40e5-9670-3f379dfd9a1e
:customerscenario: true
:expectedresults: Host collection is created and then deleted
:BZ: 1328925
:CaseImportance: Critical
"""
for name in valid_data_list():
with self.subTest(name):
new_host_col = make_host_collection({
'name': name,
'organization-id': self.organization['id'],
})
HostCollection.delete({
'name': new_host_col['name'],
'organization-id': self.organization['id'],
})
with self.assertRaises(CLIReturnCodeError):
HostCollection.info({'id': new_host_col['id']})
示例2: test_positive_delete_by_id
# 需要导入模块: from robottelo.cli.hostcollection import HostCollection [as 别名]
# 或者: from robottelo.cli.hostcollection.HostCollection import delete [as 别名]
def test_positive_delete_by_id(self):
"""Check if host collection can be created and deleted
@Feature: Host Collection
@Assert: Host collection is created and then deleted
"""
for name in valid_data_list():
with self.subTest(name):
new_host_col = self._new_host_collection({"name": name})
HostCollection.delete({"id": new_host_col["id"], "organization-id": self.org["id"]})
with self.assertRaises(CLIReturnCodeError):
HostCollection.info({"id": new_host_col["id"]})
示例3: test_positive_delete_1
# 需要导入模块: from robottelo.cli.hostcollection import HostCollection [as 别名]
# 或者: from robottelo.cli.hostcollection.HostCollection import delete [as 别名]
def test_positive_delete_1(self, test_data):
"""@Test: Check if host collection can be created and deleted
@Feature: Host Collection
@Assert: Host collection is created and then deleted
"""
new_host_col = self._new_host_collection({'name': test_data['name']})
# Assert that name matches data passed
self.assertEqual(new_host_col['name'], test_data['name'])
# Delete it
result = HostCollection.delete(
{'id': new_host_col['id'],
'organization-id': self.org['id']})
self.assertEqual(result.return_code, 0)
self.assertEqual(len(result.stderr), 0)
# Fetch it
result = HostCollection.info(
{
'id': new_host_col['id'],
}
)
self.assertNotEqual(result.return_code, 0)
self.assertGreater(len(result.stderr), 0)
示例4: test_positive_delete_1
# 需要导入模块: from robottelo.cli.hostcollection import HostCollection [as 别名]
# 或者: from robottelo.cli.hostcollection.HostCollection import delete [as 别名]
def test_positive_delete_1(self):
"""@Test: Check if host collection can be created and deleted
@Feature: Host Collection
@Assert: Host collection is created and then deleted
"""
for name in valid_data_list():
with self.subTest(name):
new_host_col = self._new_host_collection({'name': name})
HostCollection.delete({
'id': new_host_col['id'],
'organization-id': self.org['id'],
})
with self.assertRaises(CLIReturnCodeError):
HostCollection.info({'id': new_host_col['id']})
示例5: test_positive_delete_by_id
# 需要导入模块: from robottelo.cli.hostcollection import HostCollection [as 别名]
# 或者: from robottelo.cli.hostcollection.HostCollection import delete [as 别名]
def test_positive_delete_by_id(self):
"""Check if host collection can be created and deleted
@id: ef54a26e-a18f-4f29-8ef4-a7124785dbae
@Assert: Host collection is created and then deleted
@BZ: 1328925
"""
for name in valid_data_list():
with self.subTest(name):
new_host_col = self._new_host_collection({'name': name})
HostCollection.delete({
'id': new_host_col['id'],
'organization-id': self.org['id'],
})
with self.assertRaises(CLIReturnCodeError):
HostCollection.info({'id': new_host_col['id']})
示例6: test_positive_delete_by_id
# 需要导入模块: from robottelo.cli.hostcollection import HostCollection [as 别名]
# 或者: from robottelo.cli.hostcollection.HostCollection import delete [as 别名]
def test_positive_delete_by_id(self):
"""Check if host collection can be created and deleted by id
:id: ef54a26e-a18f-4f29-8ef4-a7124785dbae
:expectedresults: Host collection is created and then deleted
:BZ: 1328925
:CaseImportance: Critical
"""
for name in valid_data_list():
with self.subTest(name):
new_host_col = make_host_collection({
'name': name,
'organization-id': self.organization['id'],
})
HostCollection.delete({
'id': new_host_col['id'],
})
with self.assertRaises(CLIReturnCodeError):
HostCollection.info({'id': new_host_col['id']})