def test_noop_shuffling_buffer(buffer_type):
    """Noop should not do any shuffling. Add/retrieve some items while checking correcness of can_retrieve"""
    q = buffer_type()

    # Empty buffer. Can add, can not retrieve with zero size
    assert q.size == 0
    assert q.can_add()
    assert not q.can_retrieve()

    # Try adding some items. Check queue size and can_retrieve indicator
    _add_many(q, [1])
    assert q.can_add()
    assert q.size == 1

    _add_many(q, [2, 3])
    assert q.size == 3

    assert 1 == _retrieve(q)
    assert q.can_retrieve()

    assert 2 == _retrieve(q)
    assert 3 == _retrieve(q)
    assert not q.can_retrieve()
    assert q.size == 0

    q.finish()
    if isinstance(q, BatchedNoopShufflingBuffer):
        assert q._done_adding
Noop should not do any shuffling. Add/retrieve some items while checking correcness of can_retrieve
petastorm/tests/test_shuffling_buffer.py