Ejemplo n.º 1
0
def test_limited_queue():
    limited_service = QueueService(max_calls=1)
    call = 'a call'

    limited_service.put(call)

    with pytest.raises(QueueFullError):
        limited_service.put(call)
Ejemplo n.º 2
0
def test_get_call(unbounded_service):
    service = QueueService()
    call = 'call 1'
    call2 = 'call 2'

    service.put(call)
    service.put(call2)

    assert service.get() == call
    assert service.get() == call2
Ejemplo n.º 3
0
def full_service():
    service = QueueService(max_calls=1)
    service.put('something')

    return service
Ejemplo n.º 4
0
def queue_full_manager(database):
    full_queue = QueueService(max_calls=1)
    full_queue.put('cid')
    return WorkflowManager(database, full_queue)