Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 5
0
 def test_week_schedule_9to5(self):
     index = pd.date_range('20170701', '20170708', freq='H')
     self.assertEqual(utils.week_schedule(index).sum(), 40)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 9
0
 def test_week_schedule_9to5(self):
     index = pd.date_range('20170701', '20170708', freq='H')
     self.assertEqual(utils.week_schedule(index).sum(), 40)