def test_next_friday(self, mock): """ Should return the next friday today """ mock.return_value = datetime(2019, 11, 1, 20, 50, 30) self.assertEqual(job.datetime_from_config('fri', '19:50:50'), datetime(2019, 11, 8, 19, 50, 50))
def test_fri_today(self, mock): """ Should return at the today """ mock.return_value = datetime(2019, 11, 1, 20, 50, 30) self.assertEqual(job.datetime_from_config('fri', '22:50:50'), datetime(2019, 11, 1, 22, 50, 50))
def test_monthy_today(self, mock): """ Should return at the next month""" mock.return_value = datetime(2019, 11, 1, 20, 50, 30) self.assertEqual(job.datetime_from_config('monthly', '22:50:50'), datetime(2019, 11, 1, 22, 50, 50))
def test_daily_tomorrow(self, mock): """ Should return at the next day""" mock.return_value = datetime(2019, 11, 1, 20, 50, 30) self.assertEqual(job.datetime_from_config('daily', '19:50:50'), datetime(2019, 11, 2, 19, 50, 50))
def test_daily_today(self, mock): """ Should return at the same day""" mock.return_value = datetime(2019, 11, 1, 20, 50, 30) self.assertEqual(job.datetime_from_config('daily', '23:50:50'), datetime(2019, 11, 1, 23, 50, 50))
def test_weekly_next_week_monday(self, mock): """ Should return the next friday today """ mock.return_value = datetime(2019, 11, 4, 15, 50, 30) self.assertEqual(job.datetime_from_config('weekly', '10:50:50'), datetime(2019, 11, 11, 10, 50, 50))