Ejemplo n.º 1
0
def SCB_2():
    scb_a = buffer.SharedCircularBuffer("test_buffer_1",
                                        create=True,
                                        item_size=3)
    scb_b = buffer.SharedCircularBuffer("test_buffer_1", item_size=3)
    yield (scb_a, scb_b)
    scb_b.cleanup()
    scb_a.cleanup()
Ejemplo n.º 2
0
def test_raises_ValueError_when_length_less_than_2():
    with pytest.raises(ValueError) as exc_info:
        _scb = buffer.SharedCircularBuffer("test_buffer_1", length=1)
    assert exc_info.type is ValueError
Ejemplo n.º 3
0
def SCB_1():
    scb_a = buffer.SharedCircularBuffer("test_buffer_1", create=True)
    scb_b = buffer.SharedCircularBuffer("test_buffer_1")
    yield (scb_a, scb_b)
    scb_b.cleanup()
    scb_a.cleanup()
Ejemplo n.º 4
0
def test_error_raised_when_buffer_attempted_to_be_created_but_already_exists(
        SCB_1):
    with pytest.raises(errors.BufferAlreadyCreated) as exc_info:
        _scb = buffer.SharedCircularBuffer("test_buffer_1", create=True)
    assert exc_info.type is errors.BufferAlreadyCreated