Exemplo n.º 1
0
def test_query_by_user_type_1(calendar: services.InterviewCalendar,
                              test_data_set_1):
    interviews = list(calendar.query(user_type=services.UserType.Interviewer))
    assert len(interviews) == 8

    candidates = list(calendar.query(user_type=services.UserType.Candidate))
    assert len(candidates) == 4
Exemplo n.º 2
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
Exemplo 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
Exemplo n.º 4
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
Exemplo n.º 5
0
def test_query_by_name_2(calendar: services.InterviewCalendar,
                         test_data_set_1):
    results = list(calendar.query('User 2'))
    assert len(results) == 4
Exemplo n.º 6
0
def test_query_by_time_frame_3(calendar: services.InterviewCalendar,
                               test_data_set_1):
    # This is intersection time frame for both type of users
    time_frame = (datetime(2018, 7, 10, 13), datetime(2018, 7, 10, 16))
    results = list(calendar.query(time_frame=time_frame))
    assert len(results) == 3 * 2
Exemplo n.º 7
0
def test_query_by_time_frame_2(calendar: services.InterviewCalendar,
                               test_data_set_1):
    # This is available for candidate only
    time_frame = (datetime(2018, 7, 10, 16), datetime(2018, 7, 10, 20))
    results = list(calendar.query(time_frame=time_frame))
    assert len(results) == 1
Exemplo n.º 8
0
def test_query_1(calendar: services.InterviewCalendar, test_data_set_1):
    all_ = list(calendar.query())
    assert len(all_) == 12
Exemplo n.º 9
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