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


Python ContentHost.list方法代碼示例

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


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

示例1: test_positive_unregister

# 需要導入模塊: from robottelo.cli.contenthost import ContentHost [as 別名]
# 或者: from robottelo.cli.contenthost.ContentHost import list [as 別名]
    def test_positive_unregister(self):
        """Unregister Content host

        @feature: Content host

        @assert: After unregistering, Content hosts list for the org does not
        show the Content host
        """
        activation_key = make_activation_key({
            'content-view-id': self.PROMOTED_CV['id'],
            'lifecycle-environment-id': self.NEW_LIFECYCLE['id'],
            'organization-id': self.NEW_ORG['id'],
        })
        with VirtualMachine(distro='rhel71') as client:
            client.install_katello_ca()
            client.register_contenthost(
                activation_key['name'],
                self.NEW_ORG['label'],
            )
            result = ContentHost.list({'organization-id': self.NEW_ORG['id']})
            self.assertGreaterEqual(len(result), 1)
            self.assertIn(client.hostname, [chost['name'] for chost in result])
            result = client.run('subscription-manager unregister')
            self.assertEqual(result.return_code, 0)
            result = ContentHost.list({'organization-id': self.NEW_ORG['id']})
            self.assertNotIn(
                client.hostname, [chost['name'] for chost in result])
開發者ID:kanchan04katare,項目名稱:robottelo,代碼行數:29,代碼來源:test_contenthost.py

示例2: test_positive_list

# 需要導入模塊: from robottelo.cli.contenthost import ContentHost [as 別名]
# 或者: from robottelo.cli.contenthost.ContentHost import list [as 別名]
    def test_positive_list(self):
        """List Content hosts for a given org

        @id: b9c056cd-11ca-4870-bac4-0ebc4a782cb0

        @Assert: Content hosts are listed for the given org

        @CaseLevel: System
        """
        activation_key = make_activation_key({
            'content-view-id': self.PROMOTED_CV['id'],
            'lifecycle-environment-id': self.NEW_LIFECYCLE['id'],
            'organization-id': self.NEW_ORG['id'],
        })
        with VirtualMachine(distro='rhel71') as client:
            client.install_katello_ca()
            client.register_contenthost(
                activation_key['name'],
                self.NEW_ORG['label'],
            )
            result = ContentHost.list({
                'organization-id': self.NEW_ORG['id'],
                'lifecycle-environment-id': self.NEW_LIFECYCLE['id'],
            })
            self.assertGreaterEqual(len(result), 1)
            self.assertIn(client.hostname, [chost['name'] for chost in result])
開發者ID:waffle-iron,項目名稱:robottelo,代碼行數:28,代碼來源:test_contenthost.py

示例3: test_positive_list

# 需要導入模塊: from robottelo.cli.contenthost import ContentHost [as 別名]
# 或者: from robottelo.cli.contenthost.ContentHost import list [as 別名]
    def test_positive_list(self):
        """List Content hosts for a given org

        @feature: Content host

        @assert: Content hosts are listed for the given org
        """
        activation_key = make_activation_key(
            {
                "content-view-id": self.PROMOTED_CV["id"],
                "lifecycle-environment-id": self.NEW_LIFECYCLE["id"],
                "organization-id": self.NEW_ORG["id"],
            }
        )
        with VirtualMachine(distro="rhel71") as client:
            client.install_katello_ca()
            client.register_contenthost(activation_key["name"], self.NEW_ORG["label"])
            result = ContentHost.list({"organization-id": self.NEW_ORG["id"]})
            self.assertGreaterEqual(len(result), 1)
            self.assertIn(client.hostname, [chost["name"] for chost in result])
開發者ID:adammhaile,項目名稱:robottelo,代碼行數:22,代碼來源:test_contenthost.py


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