当前位置: 首页>>代码示例>>Python>>正文


Python NodesHttpDistributor.create_consumer_payload方法代码示例

本文整理汇总了Python中pulp_node.distributors.http.distributor.NodesHttpDistributor.create_consumer_payload方法的典型用法代码示例。如果您正苦于以下问题:Python NodesHttpDistributor.create_consumer_payload方法的具体用法?Python NodesHttpDistributor.create_consumer_payload怎么用?Python NodesHttpDistributor.create_consumer_payload使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pulp_node.distributors.http.distributor.NodesHttpDistributor的用法示例。


在下文中一共展示了NodesHttpDistributor.create_consumer_payload方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_payload

# 需要导入模块: from pulp_node.distributors.http.distributor import NodesHttpDistributor [as 别名]
# 或者: from pulp_node.distributors.http.distributor.NodesHttpDistributor import create_consumer_payload [as 别名]
    def test_payload(self, mock_repo_model):
        mock_repo = mock_repo_model.objects.get_repo_or_missing_resource.return_value
        self.populate()

        with mock_config.patch({'server': {'storage_dir': self.parentfs}}):
            dist = NodesHttpDistributor()
            repo = Repository(self.REPO_ID)
            payload = dist.create_consumer_payload(repo, self.dist_conf(), {})
            f = open('/tmp/payload', 'w+')
            f.write(repr(payload['importers']))
            f.close()

        # Verify
        distributors = payload['distributors']
        importers = payload['importers']
        repository = payload['repository']
        self.assertTrue(isinstance(distributors, list))
        self.assertTrue(isinstance(importers, list))
        self.assertEqual(repository['id'], mock_repo.repo_id)
        self.assertEqual(repository['display_name'], mock_repo.display_name)
        self.assertEqual(repository['description'], mock_repo.description)
        self.assertEqual(repository['notes'], mock_repo.notes)
        self.assertEqual(repository['scratchpad'], mock_repo.scratchpad)
        self.assertTrue(len(importers), 1)
        for key in ('id', 'importer_type_id', 'config'):
            self.assertTrue(key in importers[0])
        for key in (constants.MANIFEST_URL_KEYWORD, constants.STRATEGY_KEYWORD):
            self.assertTrue(key in importers[0]['config'])
开发者ID:maxamillion,项目名称:pulp,代码行数:30,代码来源:test_plugins.py

示例2: test_payload_with_ssl

# 需要导入模块: from pulp_node.distributors.http.distributor import NodesHttpDistributor [as 别名]
# 或者: from pulp_node.distributors.http.distributor.NodesHttpDistributor import create_consumer_payload [as 别名]
 def test_payload_with_ssl(self):
     # Setup
     self.populate()
     pulp_conf.set('server', 'storage_dir', self.parentfs)
     # Test
     dist = NodesHttpDistributor()
     repo = Repository(self.REPO_ID)
     payload = dist.create_consumer_payload(repo, self.dist_conf_with_ssl(), {})
开发者ID:bartwo,项目名称:pulp,代码行数:10,代码来源:test_plugins.py

示例3: test_payload

# 需要导入模块: from pulp_node.distributors.http.distributor import NodesHttpDistributor [as 别名]
# 或者: from pulp_node.distributors.http.distributor.NodesHttpDistributor import create_consumer_payload [as 别名]
 def test_payload(self):
     # Setup
     self.populate()
     pulp_conf.set('server', 'storage_dir', self.parentfs)
     # Test
     dist = NodesHttpDistributor()
     repo = Repository(self.REPO_ID)
     payload = dist.create_consumer_payload(repo, self.dist_conf(), {})
     f = open('/tmp/payload', 'w+')
     f.write(repr(payload['importers']))
     f.close()
     # Verify
     distributors = payload['distributors']
     importers = payload['importers']
     repository = payload['repository']
     self.assertTrue(isinstance(distributors, list))
     self.assertTrue(isinstance(importers, list))
     self.assertTrue(isinstance(repository, dict))
     self.assertTrue(len(importers), 1)
     for key in ('id', 'importer_type_id', 'config'):
         self.assertTrue(key in importers[0])
     for key in (constants.MANIFEST_URL_KEYWORD, constants.STRATEGY_KEYWORD):
         self.assertTrue(key in importers[0]['config'])
开发者ID:ipanova,项目名称:pulp,代码行数:25,代码来源:test_plugins.py


注:本文中的pulp_node.distributors.http.distributor.NodesHttpDistributor.create_consumer_payload方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。