Ejemplo n.º 1
0
def test_deallocate_valid_1(calendar: services.InterviewCalendar,
                            test_data_set_1):
    # Remove valid time frame from User 1
    time_frame = (datetime(2018, 7, 10, 12), datetime(2018, 7, 10, 16))
    calendar.deallocate('User 1', services.UserType.Interviewer, time_frame)
    results = list(calendar.query('User 1'))
    assert len(results) == 4
Ejemplo n.º 2
0
def test_deallocate_invalid_2(calendar: services.InterviewCalendar,
                              test_data_set_1):
    # Remove valid user with invalid type
    time_frame = (datetime(2018, 7, 10), datetime(2018, 7, 11))
    calendar.deallocate('User 1', services.UserType.Candidate, time_frame)
    results = list(calendar.query('User 1'))
    assert len(results) == 8
Ejemplo n.º 3
0
def test_deallocate_invalid_3(calendar: services.InterviewCalendar,
                              test_data_set_1):
    # Remove invalid user
    time_frame = (datetime(2018, 7, 10), datetime(2018, 7, 11))
    calendar.deallocate('User 3', services.UserType.Interviewer, time_frame)
    results = list(calendar.query())
    assert len(results) == 12
Ejemplo n.º 4
0
def test_deallocate_valid_2(calendar: services.InterviewCalendar,
                            test_data_set_1):
    time_frame = (datetime(2018, 7, 10, 13), datetime(2018, 7, 10, 17))
    calendar.deallocate('User 2', services.UserType.Candidate, time_frame)
    results = list(calendar.query('User 2'))
    assert len(results) == 0