def test_add_donation_7():
    assert m.add_donation(-100.0045, 'Papa Smurf') == None
def test_add_donation_5():
    assert m.add_donation(50, 'Papa Smurf') == 50
    m.donor_history['Papa Smurf'].pop()  # restore dict for next tests
def test_add_donation_6():
    assert m.add_donation(0, 'Papa Smurf') == None
def test_add_donation_3():
    assert m.add_donation(-100.0045, 'C. N. Enome') == None
def test_add_donation_4():
    assert m.add_donation('dfjasljdfa', 'C. N. Enome') == None
def test_add_donation():
    mr.clear_db()
    mr.add_donation("alpha", 100)
    assert (mr.get_db()["alpha"] == [100])
def test_add_donation_2():
    assert m.add_donation(0, 'C. N. Enome') == None
Beispiel #8
0
def test_add_donations_empty_value_list():
    db = {"A Name": [], "B Name": [2]}
    add_donation(db, "A Name", 3)
    res_db = {"A Name": [3], "B Name": [2]}
    assert db == res_db
Beispiel #9
0
def test_add_donation():
    '''Verify add_donation function successfully adds a new donor and donation to database'''
    mailroom.add_donation('Lisa Ferrier', 1000)
    assert "Lisa Ferrier" in mailroom.donors
    assert mailroom.donors["Lisa Ferrier"] == [1000]
Beispiel #10
0
def test_add_donations_empty_db():
    db = {}
    add_donation(db, "A Name", 1)
    res_db = {"A Name": [1]}
    assert db == res_db
Beispiel #11
0
def test_add_donations_name_in_db():
    db = {"A Name": [1], "B Name": [2]}
    add_donation(db, "A Name", 3)
    res_db = {"A Name": [1, 3], "B Name": [2]}
    assert db == res_db
def test_5():
    '''test function that adds donations to new person'''
    a = {'Ryan Moore': [500, 250]}
    b = {'Ryan Moore': [500, 250], 'John': [1000]}
    mailroom.add_donation('John', 1000, a)
    assert a == b
def test_4():
    '''test function that adds donations to existing person'''
    a = {'Ryan Moore': [500, 250]}
    mailroom.add_donation('Ryan Moore', 500, a)
    assert a['Ryan Moore'] == [500, 250, 500]
def test_clear_db():
    mr.add_donation("alpha", 100)
    mr.clear_db()
    assert (not any(mr.get_db()))
def test_add_donation_8():
    assert m.add_donation('dfjasljdfa', 'Papa Smurf') == None
def test_add_donation_1():
    assert m.add_donation(50, 'C. N. Enome') == 50
    del m.donor_history['C. N. Enome']  # restore dict for next tests
def test_add_donation_9():
    m.add_donation(50, 'C. N. Enome')
    assert 'C. N. Enome' in m.donor_history
    del m.donor_history['C. N. Enome']  # restore dict for next tests
def test_build_thankyou():
    mr.clear_db()
    mr.add_donation("alpha", 100)
    assert (mr.build_thankyou("alpha") ==
            "Thank you, alpha, for your donation(s) of $100!\n")