Ejemplo n.º 1
0
 def setup_job(self):
     self.last_success = mock.Mock(run_time=datetime.datetime(2012, 3, 14))
     mock_scheduler = mock.create_autospec(scheduler.ConstantScheduler)
     run_collection = mock.create_autospec(JobRunCollection,
                                           last_success=self.last_success)
     self.job = job.Job("jobname",
                        mock_scheduler,
                        run_collection=run_collection)
     self.context = command_context.JobContext(self.job)
Ejemplo n.º 2
0
 def test_filler_with_job__getitem__(self):
     context = command_context.JobContext(self.filler)
     todays_date = datetime.date.today().strftime("%Y-%m-%d")
     assert_equal(context['last_success:shortdate'], todays_date)