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)
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
def full_service(): service = QueueService(max_calls=1) service.put('something') return service
def queue_full_manager(database): full_queue = QueueService(max_calls=1) full_queue.put('cid') return WorkflowManager(database, full_queue)