示例#1
0
 def test_week_schedule_halftime_with_datetime(self):
     index = pd.date_range('20170701', '20170708', freq='H')
     on_time = datetime.time(hour=9)
     off_time = datetime.time(hour=13)
     self.assertEqual(
         utils.week_schedule(index, on_time=on_time,
                             off_time=off_time).sum(), 20)
示例#2
0
 def test_week_schedule_halftime_with_datetime(self):
     index = pd.date_range('20170701', '20170708', freq='H')
     on_time = datetime.time(hour=9)
     off_time = datetime.time(hour=13)
     self.assertEqual(utils.week_schedule(index, on_time=on_time, off_time=off_time).sum(), 20)
示例#3
0
 def test_week_schedule_halftime(self):
     index = pd.date_range('20170701', '20170708', freq='H')
     self.assertEqual(utils.week_schedule(index, off_time='13:00').sum(), 20)
示例#4
0
 def test_week_schedule_7on7(self):
     index = pd.date_range('20170701', '20170708', freq='H')
     self.assertEqual(utils.week_schedule(index, off_days=[]).sum(), 56)
示例#5
0
 def test_week_schedule_9to5(self):
     index = pd.date_range('20170701', '20170708', freq='H')
     self.assertEqual(utils.week_schedule(index).sum(), 40)
示例#6
0
 def test_week_schedule_halftime(self):
     index = pd.date_range('20170701', '20170708', freq='H')
     self.assertEqual(
         utils.week_schedule(datetime_index=index,
                             off_days=['Sunday', 'Monday'],
                             off_time='13:00').sum(), 20)
示例#7
0
 def test_week_schedule_7on7(self):
     index = pd.date_range('20170701', '20170708', freq='H')
     self.assertEqual(
         utils.week_schedule(datetime_index=index, off_days=[]).sum(), 56)
示例#8
0
 def test_week_schedule_9to5(self):
     index = pd.date_range('20170701', '20170708', freq='H')
     self.assertEqual(
         utils.week_schedule(datetime_index=index,
                             off_days=['Sunday', 'Monday']).sum(), 40)
示例#9
0
 def test_week_schedule_9to5(self):
     index = pd.date_range('20170701', '20170708', freq='H')
     self.assertEqual(utils.week_schedule(index).sum(), 40)