def test_zero_weeks(self):
     task = CourseActivityWeeklyTask(
         end_date=datetime.date(2014, 1, 1),
         weeks=0
     )
     with self.assertRaises(ValueError):
         task.interval
示例#2
0
 def requires(self):
     yield CourseActivityWeeklyTask(
         end_date=self.end_date,
         weeks=self.weeks,
         n_reduce_tasks=self.n_reduce_tasks,
         credentials=self.credentials,
     )
     yield AggregateInternalReportingUserActivityTableHive(
         interval=self.interval,
         n_reduce_tasks=self.n_reduce_tasks,
     )
 def test_leap_year(self):
     task = CourseActivityWeeklyTask(
         end_date=datetime.date(2012, 2, 29),
         weeks=52
     )
     self.assertEquals(task.interval, date_interval.Custom.parse('2011-02-28-2012-02-27'))
 def test_multi_week(self):
     task = CourseActivityWeeklyTask(
         end_date=datetime.date(2014, 1, 6),
         weeks=2
     )
     self.assertEquals(task.interval, date_interval.Custom.parse('2013-12-23-2014-01-06'))
 def test_single_week(self):
     task = CourseActivityWeeklyTask(
         end_date=datetime.date(2014, 1, 1),
         weeks=1
     )
     self.assertEquals(task.interval, date_interval.Custom.parse('2013-12-23-2013-12-30'))