def test_add_new_donor(): from mailroom4 import add_new_donor db = clean_database() add_new_donor(db, 'Matt Smith', 0.50) assert len(db.keys()) == 6 assert 'Matt Smith' in db.keys() assert db['Matt Smith']['latest_don'] == 0.5
def test_add_new_donor(self): donor_db = {"Bob Johnson": [3772.32, 512.17], "Fred Billyjoe": [877.33, 455.50, 23.45], "Harry Richard": [1.50], "Old Gregg": [1663.23, 4300.87, 10432.0], "Jerry Vars": [19.95, 653.21, 99.45], } name = "Franky Jazzhands" amount = 600.0 add_new_donor(donor_db, name, amount) # keyerror on franky, donor_db returns without him in it still even though he is in it as he starts showing up in the other test reports assert donor_db["Franky Jazzhands"][-1] == 600.0
def test_add_new_donor(): name = " Jennifer Lopez" donor = mr.add_new_donor(name) donor[1].append(750) assert donor[0] == "Jennifer Lopez" assert donor[1] == [750] assert mailroom.find_donor(name) == donor
def test_add_update_new_donor(): data = {"Tom": [100, 200]} name = "Ying" amount = 8888 expected = {"Tom": [100, 200], "Ying": [8888]} actual = add_new_donor(data, name, amount) assert expected == actual
def test_add_new_donor(): add_new_donor("todd schultz", 123) assert "todd schultz" in donors[-1] assert 123 in donors[-1]
def test_1(): add_new_donor(test_dict, 'test_name', 7) assert len(test_dict.keys()) == 1 assert sum(test_dict['test_name']) == 607
def test_2(): add_new_donor(test_dict, 'test_name2', 900) assert len(test_dict.keys()) == 2 assert sum(test_dict['test_name2']) == 900
def test_adds_new_donor(): mr.add_new_donor("Zach Cooper") assert "Zach Cooper" in mr.donors assert [] == mr.donors.get("Zach Cooper")