def test_donors_add_donations_empty_value_list(): db = Donors({"A Name": [], "B Name": []}) db.add_donation("A Name", 3) expected = " A Name\n B Name" assert db.list_donors() == expected assert db["A Name"].donations == [3] assert db["B Name"].donations == []
def test_donors_add_donations_empty_db(): db = Donors() db.add_donation("A Name", 1) expected = " A Name" assert db.list_donors() == expected assert db["A Name"].name == "A Name" assert db["A Name"].donations == [1]
def test_donors_add_donations_name_in_db(): db = Donors({"A Name": [1], "B Name": [2]}) db.add_donation("A Name", 3) expected = " A Name\n B Name" assert db.list_donors() == expected assert db["A Name"].donations == [1, 3] assert db["B Name"].donations == [2]
def test_donors_add_donations_name_not_in_db(): db = Donors({"A Name": [1]}) db.add_donation("B Name", 2) expected = " A Name\n B Name" assert db.list_donors() == expected
def test_donors_list_donors_empty_value_lists(): db = Donors({"one": [], "two": [], "three": []}) expected = " one\n two\n three" assert db.list_donors() == expected
def test_donors_list_donors_multiple_items_in_db(): db = Donors({"one": [1, 2, 3], "two": [4, 5, 6], "three": [7, 8, 9]}) expected = " one\n two\n three" assert db.list_donors() == expected
def test_donors_list_donors_one_item_in_db(): db = Donors({"one": [1, 2, 3]}) expected = " one" assert db.list_donors() == expected
def test_donors_list_donors_empty_db(): db = Donors() expected = "" assert db.list_donors() == expected