Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(6)  |  Call(6)  |  Derive(0)  |  Import(0)

src/t/u/turnip-HEAD/turnip/tests/test_tasks.py   turnip(Download)
    def test_completion(self):
        w = Worker()
 
        t = model.Task.create(method='foo')
        Session.commit()
        t.start(w)
        t.retry(w)
        Session.commit()
        self.assertEqual(t.state, 'retried')
 
 
        t = model.Task.create(method='foo', recurring_cron='0 0 * * *')
        Session.commit()
 
        t.time_created = nowish
    def test_delay_resource_group(self):
        model.Task.create(method='foo', resource_group='internal')
        model.Task.create(method='foo', resource_group='internal')
        model.Task.create(method='foo', resource_group='internal')
        Session.commit()
 
        model.Task.delay_resource_group('foo', timedelta(hours=2))
        Session.commit()
 
        self.assertEqual(q.count(), 3)