예제 #1
0
 def test_indexing(self):
     wm = Workmonth(2021, 1)
     wm.read_from_database()
     self.assertEqual(Workday(2021, 1, 3).date, wm.workdays[3].date)
예제 #2
0
 def test_is_weekday_monday(self):
     wd = Workday(2021, 2, 1)
     self.assertEqual(True, wd.is_weekday())
예제 #3
0
 def test_worktime_no_start_no_end_time(self):
     wd = Workday(2021, 2, 1)
     self.assertEqual(timedelta(), wd.worktime)
예제 #4
0
 def test_worktime_getter(self):
     wd = Workday(2021, 2, 1)
     wd.start_time = 7, 0
     wd.end_time = 15, 30
     self.assertEqual(timedelta(hours=8, minutes=30), wd.worktime)
예제 #5
0
 def test_end_date_setter(self):
     wd = Workday(2021, 2, 1)
     wd.end_time = 15, 30
     self.assertEqual(datetime(2021, 2, 1, 15, 30), wd.end_time)
예제 #6
0
 def test_start_date_setter(self):
     wd = Workday(2021, 2, 1)
     wd.start_time = 7, 0
     self.assertEqual(datetime(2021, 2, 1, 7, 0), wd.start_time)
예제 #7
0
 def test_date_getter(self):
     wd = Workday(2021, 2, 1)
     self.assertEqual(datetime(year=2021, month=2, day=1), wd.date)