本文整理汇总了Python中chacra.models.Repo.filter_by方法的典型用法代码示例。如果您正苦于以下问题:Python Repo.filter_by方法的具体用法?Python Repo.filter_by怎么用?Python Repo.filter_by使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类chacra.models.Repo
的用法示例。
在下文中一共展示了Repo.filter_by方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_marks_multiple_projects
# 需要导入模块: from chacra.models import Repo [as 别名]
# 或者: from chacra.models.Repo import filter_by [as 别名]
def test_marks_multiple_projects(self, session, tmpdir):
pecan.conf.binary_root = str(tmpdir)
pecan.conf.repos = {
'ceph': {
'all': {'ceph-deploy': ['master']},
},
'rhcs': {
'all': {'ceph-deploy': ['master']},
},
'__force_dict__': True,
}
session.commit()
session.app.post(
'/binaries/ceph-deploy/master/centos/6/x86_64/',
upload_files=[('file', 'ceph-deploy_9.0.0-0.el6.x86_64.rpm', 'hello tharrrr')]
)
ceph_project = Project.filter_by(name='ceph').first()
rhcs_project = Project.filter_by(name='rhcs').first()
assert Repo.filter_by(project=ceph_project).first().needs_update is True
assert Repo.filter_by(project=rhcs_project).first().needs_update is True
示例2: test_marks_nonexsitent_related_project_type
# 需要导入模块: from chacra.models import Repo [as 别名]
# 或者: from chacra.models.Repo import filter_by [as 别名]
def test_marks_nonexsitent_related_project_type(self, session, tmpdir):
pecan.conf.binary_root = str(tmpdir)
pecan.conf.repos = {
'ceph': {
'all': {'ceph-deploy': ['master']}
},
'__force_dict__': True,
}
session.app.post(
'/binaries/ceph-deploy/master/centos/6/x86_64/',
upload_files=[('file', 'ceph-deploy_9.0.0-0.el6.x86_64.rpm', 'hello tharrrr')]
)
project = Project.filter_by(name='ceph').first()
repo = Repo.filter_by(project=project).first()
assert repo.type == 'rpm'
示例3: test_marks_nonexsitent_related_project
# 需要导入模块: from chacra.models import Repo [as 别名]
# 或者: from chacra.models.Repo import filter_by [as 别名]
def test_marks_nonexsitent_related_project(self, session, tmpdir):
pecan.conf.binary_root = str(tmpdir)
pecan.conf.repos = {
'ceph': {
'all': {'ceph-deploy': ['master']}
},
'__force_dict__': True,
}
session.app.post(
'/binaries/ceph-deploy/master/centos/6/x86_64/',
upload_files=[('file', 'ceph-deploy_9.0.0-0.el6.x86_64.rpm', 'hello tharrrr')]
)
project = Project.filter_by(name='ceph').first()
# should've create the ceph project because it didn't exist
assert project is not None
repo = Repo.filter_by(project=project).first()
assert repo.needs_update is True