def test_list_uncompleted(inputs, labels):
    q = SimpleLabellingQueue()
    q.enqueue_many(inputs)

    popped_ids = []
    for i in range(5):
        id_, val = q.pop()
        q.submit(id_, labels[i])

        popped_ids.append(id_)

    ids, x = q.list_uncompleted()

    assert len(ids) == (len(inputs) - 5)
    # test that the popped IDs and completed IDs don't share members
    assert pytest.helpers.no_shared_members(ids, popped_ids)
    assert pytest.helpers.same_elements(x, inputs[5:])
def test_enqueue_dataframe(inputs):
    n = len(inputs)
    q = SimpleLabellingQueue()
    q.enqueue_many(inputs)
    assert len(q.data) == n
    # assert we can pop everything:
    for _ in range(n):
        id_, val = q.pop()
        assert isinstance(val, pd.Series)
    # assert there's nothing else to pop:
    with pytest.raises(IndexError):
        q.pop()
    # assert it re-constructs a df on list all
    if n > 0:
        ids, X, y = q.list_all()
        assert isinstance(X, pd.DataFrame) or len(X) == 0
        # assert it re-constructs a df on list uncomplete
        q.submit(ids[0], "hello")
        ids, X = q.list_uncompleted()
        assert isinstance(X, pd.DataFrame) or len(X) == 0
        # assert it re-constructs a df on list uncomplete
        ids, X, y = q.list_completed()
        assert isinstance(X, pd.DataFrame) or len(X) == 0