Beispiel #1
0
    def test_get_national_holidays(self, login, auth_user_id, absences):
        absence = Absence(2019, 8)
        national_holidays = absence.get_national_holidays()

        assert len(national_holidays
                   ) == 1, 'National holidays should only have one day'
        assert national_holidays[0] == date(2019, 8, 19)
Beispiel #2
0
    def test_workday(self):
        year = 2021
        month = 2
        day = 3
        absence = Absence(year=year, month=month, day=day)

        assert absence.workday == datetime(year=year, month=month,
                                           day=day).date()
Beispiel #3
0
 def test_get_holidays(self, login, auth_user_id, absences):
     absence = Absence(2019, 8)
     holidays = absence.get_holidays()
     for i, day in enumerate(range(10, 31)):
         assert holidays[i] == date(2019, 8, day)
Beispiel #4
0
 def test_get_user_id(self, login, auth_user_id, user_id, absences):
     absence = Absence(2019, 5)
     assert absence.user_id == user_id, 'User id is not correct'
Beispiel #5
0
 def test_create_register(self, login, auth_user_id, timespans_create,
                          absences, month, expected):
     absence = Absence(2019, month)
     start = datetime(2019, month, 19)
     end = datetime(2019, month, 19, 1)
     assert absence.create_register(start, end) == expected
Beispiel #6
0
 def test_get_token(self, login, auth_user_id, token, absences):
     absence = Absence(2019, 2)
     assert absence.token == token, 'Token is not correct'
Beispiel #7
0
    def test_is_reduced_workday(self, register_date, expected):
        absence = Absence(year=register_date.year,
                          month=register_date.month,
                          day=register_date.day)

        assert absence.is_reduced_workday is expected
Beispiel #8
0
    def test_is_summertime(self, month, expected):
        absence = Absence(year=2021, month=month, day=1)

        assert absence.is_summertime == expected
Beispiel #9
0
    def test_is_friday(self, day, expected):
        absence = Absence(year=2021, month=2, day=day)

        assert absence.is_friday == expected