def test_reface_ultima_cheltuiala():
    l = []
    undolist = []
    adauga_cheltuiala(l, creeaza_cheltuiala(1, 150, "mancare"), undolist)
    assert (len(l) == 1)
    reface_ultima_cheltuiala(l, undolist)
    assert (len(l) == 0)
    
    adauga_cheltuiala(l, creeaza_cheltuiala(1, 150, "mancare"), undolist)
    adauga_cheltuiala(l, creeaza_cheltuiala(3, 250, "mancare"), undolist)
    adauga_cheltuiala(l, creeaza_cheltuiala(4, 650, "telefon"), undolist)
    assert (len(l) == 3)
    reface_ultima_cheltuiala(l, undolist)
    assert (len(l) == 2)
    reface_ultima_cheltuiala(l, undolist)
    assert (len(l) == 1)
def test_reface_ultima_cheltuiala():
    l = []
    undolist = []
    adauga_cheltuiala(l, creeaza_cheltuiala(1, 150, "mancare"), undolist)
    assert (len(l) == 1)
    reface_ultima_cheltuiala(l, undolist)
    assert (len(l) == 0)

    adauga_cheltuiala(l, creeaza_cheltuiala(1, 150, "mancare"), undolist)
    adauga_cheltuiala(l, creeaza_cheltuiala(3, 250, "mancare"), undolist)
    adauga_cheltuiala(l, creeaza_cheltuiala(4, 650, "telefon"), undolist)
    assert (len(l) == 3)
    reface_ultima_cheltuiala(l, undolist)
    assert (len(l) == 2)
    reface_ultima_cheltuiala(l, undolist)
    assert (len(l) == 1)
def ui_reface_ultima_cheltuiala(l, undolist):
    reface_ultima_cheltuiala(l, undolist)
    print("Lista a fost refacuta cu cheltuielile anterioare")
def ui_reface_ultima_cheltuiala(l, undolist):
    reface_ultima_cheltuiala(l, undolist)
    print("Lista a fost refacuta cu cheltuielile anterioare")