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


Python Repo.get方法代码示例

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


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

示例1: test_02_get_repo

# 需要导入模块: from pulp_auto.repo import Repo [as 别名]
# 或者: from pulp_auto.repo.Repo import get [as 别名]
 def test_02_get_repo(self):
     repo = Repo.get(self.pulp, self.repo.id)
     self.assertEqual(repo.id, self.repo.id)
     self.repo.reload(self.pulp)
     self.assertEqual(self.repo, repo)
     #get unexistant repo
     with self.assertRaises(AssertionError):
         Repo.get(self.pulp, 'some_id')
     self.assertPulp(code=404)
开发者ID:jeremycline,项目名称:pulp-automation,代码行数:11,代码来源:test_2_rpm_repo.py

示例2: test_07_sync_repo

# 需要导入模块: from pulp_auto.repo import Repo [as 别名]
# 或者: from pulp_auto.repo.Repo import get [as 别名]
 def test_07_sync_repo(self):
     x = Repo.get(self.pulp, self.repo.id).data['content_unit_counts']['puppet_module']
     response = self.repo.sync(self.pulp)
     self.assertPulp(code=202)
     Task.wait_for_report(self.pulp, response)
     y = Repo.get(self.pulp, self.repo.id).data['content_unit_counts']['puppet_module']
     #FIXME result can change with time as number of modules is not constant!
     #check that the second i.e. updated query was also processed.
     self.assertTrue(x != y)
开发者ID:CUXIDUMDUM,项目名称:pulp-automation,代码行数:11,代码来源:test_11_puppet_modules_repo.py

示例3: test_02_copy_repo1_to_repo2

# 需要导入模块: from pulp_auto.repo import Repo [as 别名]
# 或者: from pulp_auto.repo.Repo import get [as 别名]
 def test_02_copy_repo1_to_repo2(self):
     with self.pulp.asserting(True):
         response = self.repo2.copy(self.pulp, self.repo1.id, data={})
     Task.wait_for_report(self.pulp, response)
     
     #check that the number of modules are the same
     repo1 = Repo.get(self.pulp, self.repo1.id)
     repo2 = Repo.get(self.pulp, self.repo2.id)
     self.assertEqual(repo1.data['content_unit_counts'], repo2.data['content_unit_counts'])
开发者ID:RedHatQE,项目名称:pulp-automation,代码行数:11,代码来源:test_01_rpm_repo_copy.py

示例4: test_02_copy_repo_to_repo_copy_and_publish

# 需要导入模块: from pulp_auto.repo import Repo [as 别名]
# 或者: from pulp_auto.repo.Repo import get [as 别名]
    def test_02_copy_repo_to_repo_copy_and_publish(self):
        with self.pulp.asserting(True):
            response = self.repo_copy.copy(self.pulp, self.repo.id, data={})
        Task.wait_for_report(self.pulp, response)
        
        #check that the number of modules are the same
        repo = Repo.get(self.pulp, self.repo.id)
        repo_copy = Repo.get(self.pulp, self.repo_copy.id)
        self.assertEqual(repo.data['content_unit_counts'], repo_copy.data['content_unit_counts'])

        with self.pulp.asserting(True):        
            response = self.repo_copy.publish(self.pulp, self.distributor_copy.id)
        Task.wait_for_report(self.pulp, response)        
开发者ID:RedHatQE,项目名称:pulp-automation,代码行数:15,代码来源:test_02_iso_repo.py

示例5: pulp_repo_url

# 需要导入模块: from pulp_auto.repo import Repo [as 别名]
# 或者: from pulp_auto.repo.Repo import get [as 别名]
def pulp_repo_url(pulp, repo_id, distributor_type_id='yum_distributor'):
    '''return repo content url for given repo id or None'''
    repo = Repo.get(pulp, repo_id)
    # this should at most 1 item (for any given type)
    distributors = [distributor for distributor in repo.list_distributors(pulp) \
        if distributor['distributor_type_id'] == distributor_type_id]
    if not distributors:
        return None
    return Distributor(data=distributors[0]).content_url(pulp)
开发者ID:dparalen,项目名称:pulp-automation,代码行数:11,代码来源:upload.py

示例6: test_04_check_that_one_iso

# 需要导入模块: from pulp_auto.repo import Repo [as 别名]
# 或者: from pulp_auto.repo.Repo import get [as 别名]
 def test_04_check_that_one_iso(self):
     # check that there is precisly one module
     dest_repo2 = Repo.get(self.pulp, self.dest_repo2.id)
     self.assertEqual(dest_repo2.data["content_unit_counts"]["iso"], 1)
     # check that one exact module copied i.e. perform the search by modules name
     response = self.dest_repo2.within_repo_search(
         self.pulp, data={"criteria": {"type_ids": ["iso"], "filters": {"unit": {"name": "test.iso"}}}}
     )
     self.assertPulp(code=200)
     result = Association.from_response(response)
     # this means that only one module found with that name
     self.assertTrue(len(result) == 1)
开发者ID:preethit,项目名称:pulp-automation,代码行数:14,代码来源:test_17_iso_repo_orphans_and_copy.py

示例7: test_06_child_repo_content

# 需要导入模块: from pulp_auto.repo import Repo [as 别名]
# 或者: from pulp_auto.repo.Repo import get [as 别名]
    def test_06_child_repo_content(self):
        # access the content of the pulp_child node
        # please note when the repo is created on the other node,
        # the distributor id used by default is yum_distributor

        # make sure the repo was published on the child node
        # the repo ID and distributor ID are the same on both the nodes
        child_repo = Repo.get(self.pulp_child, self.repo.id)
        response = child_repo.publish(self.pulp_child, self.distributor.id)
        assert response == ResponseLike(202), 'wrong response from the child node: %s' % response
        Task.wait_for_report(self.pulp_child, response)

        # fetch the repo content url on the child node
        repo_url = pulp_repo_url(self.pulp_child, self.repo.id)
        assert repo_url, 'invalid repo id on pulp_child node'
        # try accessing the content on the child node
        pkg_name = download_package_with_dnf(self.pulp_child, repo_url, 'bear')
        assert pkg_name == 'bear', 'not able to acces bear rpm on the child node'
开发者ID:CUXIDUMDUM,项目名称:pulp-automation,代码行数:20,代码来源:test_01_cud.py

示例8: test_04_update_repo

# 需要导入模块: from pulp_auto.repo import Repo [as 别名]
# 或者: from pulp_auto.repo.Repo import get [as 别名]
 def test_04_update_repo(self):
     display_name = 'A %s repo' % self.__class__.__name__
     self.repo |= {'display_name': display_name}
     self.repo.update(self.pulp)
     self.assertPulp(code=200)
     self.assertEqual(Repo.get(self.pulp, self.repo.id).data['display_name'], display_name)
开发者ID:alexxa,项目名称:pulp-automation,代码行数:8,代码来源:test_15_iso_repo.py

示例9: test_02_get_repo

# 需要导入模块: from pulp_auto.repo import Repo [as 别名]
# 或者: from pulp_auto.repo.Repo import get [as 别名]
 def test_02_get_repo(self):
     repo = Repo.get(self.pulp, self.repo.id)
     self.assertEqual(repo.id, self.repo.id)
     self.repo.reload(self.pulp)
     self.assertEqual(self.repo, repo)
开发者ID:alexxa,项目名称:pulp-automation,代码行数:7,代码来源:test_15_iso_repo.py

示例10: test_02_check_all_iso_copied

# 需要导入模块: from pulp_auto.repo import Repo [as 别名]
# 或者: from pulp_auto.repo.Repo import get [as 别名]
 def test_02_check_all_iso_copied(self):
     source_repo = Repo.get(self.pulp, self.source_repo.id)
     dest_repo1 = Repo.get(self.pulp, self.dest_repo1.id)
     #check that the number of puppet modules are the same
     self.assertEqual(source_repo.data['content_unit_counts'], dest_repo1.data['content_unit_counts'])
开发者ID:lenfree,项目名称:pulp-automation,代码行数:7,代码来源:test_17_iso_repo_orphans_and_copy.py

示例11: test_04_check_update_was_correct

# 需要导入模块: from pulp_auto.repo import Repo [as 别名]
# 或者: from pulp_auto.repo.Repo import get [as 别名]
 def test_04_check_update_was_correct(self):
     self.assertEqual(Repo.get(self.pulp, self.repo.id).data['display_name'], "NewName")
     importer = self.repo.get_importer(self.pulp, "yum_importer")
     self.assertEqual(importer.data["config"]["num_units"], 6)
     distributor = self.repo.get_distributor(self.pulp, "yum_distributor")
     self.assertEqual(distributor.data["config"]["relative_url"], "my_url")
开发者ID:RedHatQE,项目名称:pulp-automation,代码行数:8,代码来源:test_02_repo_cud.py

示例12: test_03_search_erratum

# 需要导入模块: from pulp_auto.repo import Repo [as 别名]
# 或者: from pulp_auto.repo.Repo import get [as 别名]
 def test_03_search_erratum(self):
     unit = ErratumUnit.search(self.pulp, data={"criteria": {"filters": {}, "fields": ["name", "_content_type_id"]}})
     repo2 = Repo.get(self.pulp, self.repo2.id)
     # assert that number of errata _eq_ to the number repo contains
     self.assertEqual(len(unit), repo2.data['content_unit_counts']['erratum'])
开发者ID:alexxa,项目名称:pulp-automation,代码行数:7,代码来源:test_16_unit_search.py


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