def test_snapshot(self):
        project = self.create_project()
        plan = self.create_plan(project)
        step = self.create_step(plan)

        option = ItemOption(
            item_id=step.id,
            name='build.timeout',
            value='5',
        )
        db.session.add(option)
        db.session.flush()

        build = self.create_build(project=project)
        job = self.create_job(build=build, status=Status.in_progress)
        jobplan = self.create_job_plan(job, plan)

        db.session.commit()

        jobphase = self.create_jobphase(job)
        jobstep = self.create_jobstep(jobphase,
                status=Status.in_progress,
                date_started=datetime.utcnow() - timedelta(minutes=4 + _SNAPSHOT_TIMEOUT_BONUS_MINUTES))

        with patch('changes.jobs.sync_job_step._is_snapshot_job', return_value=False):
            assert has_timed_out(jobstep, jobplan, 0)

        with patch('changes.jobs.sync_job_step._is_snapshot_job', return_value=True):
            assert not has_timed_out(jobstep, jobplan, 0)
dataset/ETHPy150Open dropbox/changes/tests/changes/jobs/test_sync_job_step.py/HasTimedOutTest.test_snapshot/original