當前位置: 首頁>>代碼示例>>Python>>正文


Python ContentHost.delete方法代碼示例

本文整理匯總了Python中robottelo.cli.contenthost.ContentHost.delete方法的典型用法代碼示例。如果您正苦於以下問題:Python ContentHost.delete方法的具體用法?Python ContentHost.delete怎麽用?Python ContentHost.delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在robottelo.cli.contenthost.ContentHost的用法示例。


在下文中一共展示了ContentHost.delete方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_positive_delete_by_name

# 需要導入模塊: from robottelo.cli.contenthost import ContentHost [as 別名]
# 或者: from robottelo.cli.contenthost.ContentHost import delete [as 別名]
    def test_positive_delete_by_name(self):
        """Check if content host can be created and deleted by passing its name

        @id: 22f1206c-b712-45e9-8e65-3a0a225d6188

        @Assert: Content host is created and then deleted
        """
        for name in valid_hosts_list():
            with self.subTest(name):
                content_host = make_content_host({
                    u'content-view-id': self.DEFAULT_CV['id'],
                    u'lifecycle-environment-id': self.LIBRARY['id'],
                    u'name': name,
                    u'organization-id': self.NEW_ORG['id'],
                })
                ContentHost.delete({u'host': content_host['name']})
                with self.assertRaises(CLIReturnCodeError):
                    ContentHost.info({'id': content_host['id']})
開發者ID:waffle-iron,項目名稱:robottelo,代碼行數:20,代碼來源:test_contenthost.py

示例2: test_positive_delete_by_id

# 需要導入模塊: from robottelo.cli.contenthost import ContentHost [as 別名]
# 或者: from robottelo.cli.contenthost.ContentHost import delete [as 別名]
    def test_positive_delete_by_id(self):
        """Check if content host can be created and deleted

        @Feature: Content Hosts

        @Assert: Content host is created and then deleted

        """
        for name in generate_strings_list():
            with self.subTest(name):
                new_system = make_content_host({
                    u'content-view-id': self.DEFAULT_CV['id'],
                    u'lifecycle-environment-id': self.LIBRARY['id'],
                    u'name': name,
                    u'organization-id': self.NEW_ORG['id'],
                })
                ContentHost.delete({u'id': new_system['id']})
                with self.assertRaises(CLIReturnCodeError):
                    ContentHost.info({'id': new_system['id']})
開發者ID:kanchan04katare,項目名稱:robottelo,代碼行數:21,代碼來源:test_contenthost.py

示例3: test_positive_delete_by_id

# 需要導入模塊: from robottelo.cli.contenthost import ContentHost [as 別名]
# 或者: from robottelo.cli.contenthost.ContentHost import delete [as 別名]
    def test_positive_delete_by_id(self):
        """Check if content host can be created and deleted by passing its ID

        @id: 1aa55e52-a97e-4c11-aab1-244bd4de0dd3

        @Assert: Content host is created and then deleted

        @BZ: 1328202
        """
        for name in valid_hosts_list():
            with self.subTest(name):
                content_host = make_content_host({
                    u'content-view-id': self.DEFAULT_CV['id'],
                    u'lifecycle-environment-id': self.LIBRARY['id'],
                    u'name': name,
                    u'organization-id': self.NEW_ORG['id'],
                })
                ContentHost.delete({u'host-id': content_host['id']})
                with self.assertRaises(CLIReturnCodeError):
                    ContentHost.info({'id': content_host['id']})
開發者ID:waffle-iron,項目名稱:robottelo,代碼行數:22,代碼來源:test_contenthost.py

示例4: test_positive_delete_1

# 需要導入模塊: from robottelo.cli.contenthost import ContentHost [as 別名]
# 或者: from robottelo.cli.contenthost.ContentHost import delete [as 別名]
    def test_positive_delete_1(self):
        """@Test: Check if content host can be created and deleted

        @Feature: Content Hosts

        @Assert: Content host is created and then deleted

        """
        for name in generate_strings_list():
            with self.subTest(name):
                new_system = make_content_host(
                    {
                        u"content-view-id": self.DEFAULT_CV["id"],
                        u"lifecycle-environment-id": self.LIBRARY["id"],
                        u"name": name,
                        u"organization-id": self.NEW_ORG["id"],
                    }
                )
                ContentHost.delete({u"id": new_system["id"]})
                with self.assertRaises(CLIReturnCodeError):
                    ContentHost.info({"id": new_system["id"]})
開發者ID:cpeters,項目名稱:robottelo,代碼行數:23,代碼來源:test_contenthost.py

示例5: test_positive_delete_1

# 需要導入模塊: from robottelo.cli.contenthost import ContentHost [as 別名]
# 或者: from robottelo.cli.contenthost.ContentHost import delete [as 別名]
    def test_positive_delete_1(self, test_data):
        """@Test: Check if content host can be created and deleted

        @Feature: Content Hosts

        @Assert: Content host is created and then deleted

        """

        new_system = make_content_host({
            u'name': test_data['name'],
            u'organization-id': self.NEW_ORG['id'],
            u'content-view-id': self.DEFAULT_CV['id'],
            u'lifecycle-environment-id': self.LIBRARY['id']})
        # Assert that name matches data passed
        self.assertEqual(
            new_system['name'],
            test_data['name'],
            "Names don't match"
        )

        # Delete it
        result = ContentHost.delete({u'id': new_system['id']})
        self.assertEqual(
            result.return_code,
            0,
            "Content host was not deleted")
        self.assertEqual(
            len(result.stderr), 0, "No error was expected")

        # Fetch it
        result = ContentHost.info({
            u'id': new_system['id']})
        self.assertNotEqual(
            result.return_code,
            0,
            "Content host should not be found"
        )
        self.assertGreater(
            len(result.stderr),
            0,
            "Expected an error here"
        )
開發者ID:connornishijima,項目名稱:robottelo,代碼行數:45,代碼來源:test_contenthost.py


注:本文中的robottelo.cli.contenthost.ContentHost.delete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。