def test_is_working_hour_is_working_properly(self): """testing if the is_working_hour method is working properly """ wh = WorkingHours() wh["mon"] = [[570, 720], [780, 1110]] wh["tue"] = [[570, 720], [780, 1110]] wh["wed"] = [[570, 720], [780, 1110]] wh["thu"] = [[570, 720], [780, 1110]] wh["fri"] = [[570, 720], [780, 1110]] wh["sat"] = [[570, 720]] wh["sun"] = [] # monday check_date = datetime.datetime(2013, 4, 8, 13, 55) self.assertTrue(wh.is_working_hour(check_date)) # sunday check_date = datetime.datetime(2013, 4, 14, 13, 55) self.assertFalse(wh.is_working_hour(check_date))
def test_is_working_hour_is_working_properly(self): """testing if the is_working_hour method is working properly """ wh = WorkingHours() wh['mon'] = [[570, 720], [780, 1110]] wh['tue'] = [[570, 720], [780, 1110]] wh['wed'] = [[570, 720], [780, 1110]] wh['thu'] = [[570, 720], [780, 1110]] wh['fri'] = [[570, 720], [780, 1110]] wh['sat'] = [[570, 720]] wh['sun'] = [] # monday check_date = datetime.datetime(2013, 4, 8, 13, 55) self.assertTrue(wh.is_working_hour(check_date)) # sunday check_date = datetime.datetime(2013, 4, 14, 13, 55) self.assertFalse(wh.is_working_hour(check_date))
def test_is_working_hour_is_working_properly(self): """testing if the is_working_hour method is working properly """ wh = WorkingHours() wh['mon'] = [[570, 720], [780, 1110]] wh['tue'] = [[570, 720], [780, 1110]] wh['wed'] = [[570, 720], [780, 1110]] wh['thu'] = [[570, 720], [780, 1110]] wh['fri'] = [[570, 720], [780, 1110]] wh['sat'] = [[570, 720]] wh['sun'] = [] # monday check_date = datetime.datetime(2013, 4, 8, 13, 55) self.assertTrue(wh.is_working_hour(check_date)) # sunday check_date = datetime.datetime(2013, 4, 14, 13, 55) self.assertFalse(wh.is_working_hour(check_date))
def test_is_working_hour_is_working_properly(): """testing if the is_working_hour method is working properly """ wh = WorkingHours() wh['mon'] = [[570, 720], [780, 1110]] wh['tue'] = [[570, 720], [780, 1110]] wh['wed'] = [[570, 720], [780, 1110]] wh['thu'] = [[570, 720], [780, 1110]] wh['fri'] = [[570, 720], [780, 1110]] wh['sat'] = [[570, 720]] wh['sun'] = [] # monday import datetime import pytz check_date = datetime.datetime(2013, 4, 8, 13, 55, tzinfo=pytz.utc) assert wh.is_working_hour(check_date) is True # sunday check_date = datetime.datetime(2013, 4, 14, 13, 55, tzinfo=pytz.utc) assert wh.is_working_hour(check_date) is False