本文整理汇总了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)
示例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)
示例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'])
示例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)
示例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)
示例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)
示例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'
示例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)
示例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)
示例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'])
示例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")
示例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'])