Пример #1
0
def test_single_acquisition_response(user_client, test_scheduler):
    entry_name = simulate_acquisitions(user_client, n=1)
    acquisition, = get_acquisition_list(user_client, entry_name)
    task_id = 1
    expected_url = reverse_acquisition_detail(entry_name, task_id)

    assert acquisition['self'] == expected_url
    assert acquisition['task_id'] == task_id
Пример #2
0
def test_multiple_acquisition_response(user_client, test_scheduler):
    entry_name = simulate_acquisitions(user_client, n=3)
    acquisitions = get_acquisition_list(user_client, entry_name)
    assert len(acquisitions) == 3

    for i, acq in enumerate(acquisitions, start=1):
        expected_url = reverse_acquisition_detail(entry_name, i)
        assert acq['self'] == expected_url
        assert acq['task_id'] == i
Пример #3
0
def test_entry_with_no_acquisition_response(user_client, test_scheduler):
    entry = post_schedule(user_client, TEST_SCHEDULE_ENTRY)

    with pytest.raises(AssertionError):
        assert get_acquisition_list(user_client, entry['name'])
Пример #4
0
def test_non_existent_entry(user_client, test_scheduler):
    with pytest.raises(AssertionError):
        get_acquisition_list(user_client, 'doesntexist')