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


Python Repo.filter_by方法代码示例

本文整理汇总了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
开发者ID:ahills,项目名称:chacra,代码行数:22,代码来源:test_binaries.py

示例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'
开发者ID:ahills,项目名称:chacra,代码行数:17,代码来源:test_binaries.py

示例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
开发者ID:ahills,项目名称:chacra,代码行数:19,代码来源:test_binaries.py


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