コード例 #1
0
def remove(instance: Queue):
    if len(instance._data) == 0:
        return print("Não há elementos")

    path_file = instance._data[0]["nome_do_arquivo"]
    instance.dequeue()
    return print(f"Arquivo {path_file} removido com sucesso")
コード例 #2
0
def test_dequeue_deve_remover_um_valor_a_fila():
    queue = Queue()
    queue.enqueue(42)
    queue.enqueue(43)
    queue.enqueue(44)

    given = queue.dequeue()
    assert len(queue) == 2
    assert given == 42