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
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
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
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
def test_add_donor(): mailroom.add_donor("Sam") assert "Sam" in mailroom.donor_dict assert mailroom.get_donor_donation_list("Sam") == []
def test_make_report_with_new_donor(): mail.add_donor("Jae", 500) report = mail.make_report() assert "Jae" in report
def test_add_donor(): mail.add_donor("Jae", 500) assert "Jae" in mail.players
def test_reset_donors(): mail.add_donor("Jae", 500) mail.players = mail.reset_donors() assert "Jae" not in mail.players
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"] == []
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", [])
def test_add_donor(): mailroom.add_donor('Kris', mailroom.donor_db) assert mailroom.donor_db['Kris'] == []
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')
def test_add_donor_empty(): # extra spaces should get stripped name = " " with pytest.raises(ValueError): donor = mr.add_donor(name)