本文整理汇总了Python中pulp_auto.repo.Repo.search方法的典型用法代码示例。如果您正苦于以下问题:Python Repo.search方法的具体用法?Python Repo.search怎么用?Python Repo.search使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pulp_auto.repo.Repo
的用法示例。
在下文中一共展示了Repo.search方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_04_search_repo_in_repos
# 需要导入模块: from pulp_auto.repo import Repo [as 别名]
# 或者: from pulp_auto.repo.Repo import search [as 别名]
def test_04_search_repo_in_repos(self):
# search among puppet-repos by id
repo = Repo.search(
self.pulp,
data={
"criteria": {
"sort": None,
"fields": None,
"limit": None,
"filters": {"$and": [{"id": "SimplePuppetSearchRepoTest"}, {"notes._repo-type": "puppet-repo"}]},
"skip": None,
}
},
)
self.assertIn(Repo({"id": self.repo.id}, ["id"], ["id"]), repo)
示例2: test_05_search_repo_with_regexp
# 需要导入模块: from pulp_auto.repo import Repo [as 别名]
# 或者: from pulp_auto.repo.Repo import search [as 别名]
def test_05_search_repo_with_regexp(self):
# search puppet-repos with .*repo.*
repo = Repo.search(
self.pulp,
data={
"criteria": {
"sort": None,
"fields": None,
"limit": None,
"filters": {"$and": [{"notes._repo-type": "puppet-repo"}, {"id": {"$regex": ".*Repo.*"}}]},
"skip": None,
}
},
)
# asserting to 2 as we have two repos matched the pattern
self.assertTrue(len(repo) == 2)