Esempio n. 1
0
    def test_mixed_weekday_range_is_in(self):
        value = '1,3-4,7'

        weekdays_checker = WeekdaysChecker.new_from_value(value)
        self.assertTrue(weekdays_checker.is_in(_a_time().weekday('1').build()))
        self.assertFalse(weekdays_checker.is_in(_a_time().weekday('2').build()))
        self.assertTrue(weekdays_checker.is_in(_a_time().weekday('3').build()))
        self.assertTrue(weekdays_checker.is_in(_a_time().weekday('4').build()))
        self.assertFalse(weekdays_checker.is_in(_a_time().weekday('5').build()))
        self.assertFalse(weekdays_checker.is_in(_a_time().weekday('6').build()))
        self.assertTrue(weekdays_checker.is_in(_a_time().weekday('7').build()))
Esempio n. 2
0
 def _assert_time_is_not_in(self, current_time, value):
     weekdays_checker = WeekdaysChecker.new_from_value(value)
     self.assertFalse(weekdays_checker.is_in(current_time))