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


Python Job.created方法代码示例

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


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

示例1: test_recent_jobs

# 需要导入模块: from osci.job import Job [as 别名]
# 或者: from osci.job.Job import created [as 别名]
    def test_recent_jobs(self, now):
        now.return_value = NOW
        db = DB('sqlite://')
        db.create_schema()
        job1 = Job(change_num="change_num1", project_name="project")
        job2 = Job(change_num="change_num2", project_name="project")
        with db.get_session() as session:
            session.add(job1)
            job1.created=PAST
            job1.db = db
            job1.state=constants.RUNNING
            job1.updated=PAST
            session.add(job2)

        recent_jobs = Job.getRecent(db)
        self.assertEqual(len(recent_jobs), 1)
        recent_jobs = Job.getRecent(db, 200000)
        self.assertEqual(len(recent_jobs), 2)
开发者ID:citrix-openstack,项目名称:openstack-citrix-ci,代码行数:20,代码来源:test_job.py

示例2: test_start_test_clears_time

# 需要导入模块: from osci.job import Job [as 别名]
# 或者: from osci.job.Job import created [as 别名]
    def test_start_test_clears_time(self, now):
        now.return_value = NOW
        db = DB('sqlite://')
        db.create_schema()
        job = Job(change_num="change_num", project_name="project")
        with db.get_session() as session:
            session.add(job)
            job.created=PAST
            job.db = db

        job.update(db, state=constants.RUNNING)

        with db.get_session() as session:
            job, = session.query(Job).all()
        self.assertEquals(job.updated, NOW)
        self.assertEquals(job.state, constants.RUNNING)
        self.assertEquals(job.test_started, NOW)
        self.assertEquals(job.test_stopped, None)
        self.assertEquals("project", job.project_name)
        self.assertEquals("change_num", job.change_num)
开发者ID:citrix-openstack,项目名称:openstack-citrix-ci,代码行数:22,代码来源:test_job.py

示例3: test_update

# 需要导入模块: from osci.job import Job [as 别名]
# 或者: from osci.job.Job import created [as 别名]
    def test_update(self, now):
        now.return_value = NOW

        db = DB('sqlite://')
        db.create_schema()

        job = Job(change_num="change_num", project_name="project")
        with db.get_session() as session:
            session.add(job)
            job.created=PAST
            job.db = db

        self.assertEqual(job.state, constants.QUEUED)

        job.update(db, state=constants.FINISHED)

        with db.get_session() as session:
            job, = session.query(Job).all()

        self.assertEquals(NOW, job.updated)
        self.assertEquals(constants.FINISHED, job.state)
        self.assertEquals("project", job.project_name)
        self.assertEquals("change_num", job.change_num)
开发者ID:citrix-openstack,项目名称:openstack-citrix-ci,代码行数:25,代码来源:test_job.py


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