Example #1
0
 def test_night_shift(self):
     begin = time(8, 30)
     end = time(20, 30)
     policy = Policy(weekends=(SAT, SUN), holidays=holidays, hours=(end, begin))
     self.assertFalse(policy.is_not_in_business_hours(datetime(2011, 7, 1, 7, 0)))
     self.assertTrue(policy.is_not_in_business_hours(datetime(2011, 7, 1, 17, 0)))
     self.assertFalse(policy.is_not_in_business_hours(datetime(2011, 7, 1, 8, 30)))
Example #2
0
 def test_night_shift(self):
     begin = time(8, 30)
     end = time(20, 30)
     policy = Policy(weekends=(SAT, SUN),
                     holidays=holidays,
                     hours=(end, begin))
     self.assertFalse(
         policy.is_not_in_business_hours(datetime(2011, 7, 1, 7, 0)))
     self.assertTrue(
         policy.is_not_in_business_hours(datetime(2011, 7, 1, 17, 0)))
     self.assertFalse(
         policy.is_not_in_business_hours(datetime(2011, 7, 1, 8, 30)))
Example #3
0
 def test_no_working_hours(self):
     policy = Policy(weekends=(SAT, SUN), holidays=holidays)
     self.assertFalse(policy.is_not_in_business_hours(time(19, 25)))
Example #4
0
 def test_no_working_hours(self):
     policy = Policy(weekends=(SAT, SUN), holidays=holidays)
     self.assertFalse(policy.is_not_in_business_hours(time(19, 25)))