コード例 #1
0
def test_add_donor(monkeypatch):
    """ Tests adding a donor through UI """
    mr.initialize_donors()
    monkeypatch.setattr('builtins.input', lambda x: 'Koko')
    mr.add_donor()
    assert 'Koko' in mr.mailroom.database
    monkeypatch.setattr('builtins.input', lambda x: 'q')
    mr.add_donor()
    assert 'Kupo' not in mr.mailroom.database
コード例 #2
0
def test_add_donor():
    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
コード例 #3
0
def test_add_donor():
    mr.donor_db = mr.get_donor_db()
    name = "Fred Flintstone  "

    donor = mr.add_donor(name)
    donor[1].append(300)
    assert donor[0] == "Fred Flintstone"
    assert donor[1] == [300]
    assert mr.find_donor(name) == donor
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
コード例 #5
0
def test_add_donor():
    """
    adds a new donor

    then tests that the donor is added, and that a donation is properly recorded.
    """
    # extra spaces should get stripped
    name = "Fred Flintstone  "

    donor = mr.add_donor(name)
    donor[1].append(300)
    assert donor[0] == "Fred Flintstone"
    assert donor[1] == [300]
    assert mr.find_donor(name) == donor
コード例 #6
0
def test_add_donor():
    mailroom.add_donor("Sam")
    assert "Sam" in mailroom.donor_dict
    assert mailroom.get_donor_donation_list("Sam") == []
コード例 #7
0
def test_make_report_with_new_donor():
    mail.add_donor("Jae", 500)
    report = mail.make_report()

    assert "Jae" in report
コード例 #8
0
def test_add_donor():
    mail.add_donor("Jae", 500)

    assert "Jae" in mail.players
コード例 #9
0
def test_reset_donors():
    mail.add_donor("Jae", 500)
    mail.players = mail.reset_donors()

    assert "Jae" not in mail.players
コード例 #10
0
def test_add_donor():
    """Add a new donor using the add_donor method and ensure it's in the
    donor db and is equal to an empty list """
    mailroom.add_donor("New Donor")
    assert "New Donor" in mailroom.donor_db
    assert mailroom.donor_db["New Donor"] == []
コード例 #11
0
def test_add_donor():
    """Test the add_donor function."""

    mail.add_donor('Alexander Boone')
    donors_list = get_updated_donors_list()
    assert any(donor == 'Alexander Boone' for donor in donors_list)
def test_add_donor():
    donor_name = "Lemon    "
    donor_to_add = mailroom.add_donor(donor_name)
    # database = mailroom.donors_list

    assert donor_to_add == ("Lemon", [])
コード例 #13
0
def test_add_donor():
    mailroom.add_donor('Kris', mailroom.donor_db)
    assert mailroom.donor_db['Kris'] == []
コード例 #14
0
def test_add_donor():
    from mailroom import add_donor
    test_list = add_donor('Kenwas here')
    assert len(add_donor('Kenwas here')) > 0
    assert test_list[-1] == ('Kenwas', 'here')
コード例 #15
0
def test_add_donor_empty():
    # extra spaces should get stripped
    name = " "

    with pytest.raises(ValueError):
        donor = mr.add_donor(name)