示例#1
0
def test_add_donor():
    """
    adds a new donor

    then tests that the donor is added, and that a donation is properly recorded.
    """
    name = "Fred Flintstone  "

    donor = mailroom.add_donor(name)
    donor[1].append(300)
    assert donor[0] == "Fred Flintstone"
    assert donor[1] == [300]
    assert mailroom.find_donor(name) == donor
示例#2
0
def test_find_donor_not():
    "test one that's not there"
    donor = mailroom.find_donor("Jeff Bzos")

    assert donor is None
def test_find_donor_not():
    "test one that's not there"
    donor = mailroom.find_donor("Shawn Michs")

    assert donor is None
示例#4
0
def test_find_donor():
    """ checks a donor that is there, but with odd case and spaces"""
    donor = mailroom.find_donor("jefF beZos ")

    assert donor[0] == "Jeff Bezos"
def test_find_donor():
    """ checks a donor that is there, but with odd case and spaces"""
    donor = mailroom.find_donor("sHaWn MichAels ")

    assert donor[0] == "Shawn Michaels"