def test_list_donors(capsys): list_donors() captured = capsys.readouterr() assert captured.out == ('Jim Halpert\n' 'Pam Beesley\n' 'Dwight Shrute\n' 'Michael Scott\n' 'Andy Bernard\n')
def test_list_donors(capsys): list_donors() captured = capsys.readouterr() assert captured.out == 'Anne Hathaway\n'\ 'Geronimo Jackson\n'\ 'Dingo Dogson\n'\ 'Leo Kottke\n'\ 'Flask McCreole\n'\ 'Piglet Norquist\n'
def test_list_donors(): donors = { "Bill Gates": [100.00, 200.00, 300.00], "Jack Frost": [2.00, 5.00, 200.00], "Maya Angelou": [20000.00, 20.00, 1234.56] } list_donor_list = mailroom.list_donors(donors) assert list_donor_list == ["Bill Gates", "Jack Frost", "Maya Angelou"]
def test_list_donors(): listing = mailroom.list_donors() # hard to test this throughly -- better not to hard code the entire # thing. But check for a few aspects -- this will catchthe likley # errors assert listing.startswith("Donor list:\n") assert "Jeff Bezos" in listing assert "William Gates, III" in listing assert len(listing.split('\n')) == 5
def test_list_donors(): listing = mailroom.list_donors() # hard to test this throughly -- better not to hard code the entire # thing. But check for a few aspects -- this will catch the likely # errors assert listing.startswith("Donor list:\n") assert "Jeff Bezos" in listing assert "William Gates III" in listing assert len(listing.split('\n')) == 5
def test_list_donors(): """ Verifies content of the list_donors output. """ donor_db = mailroom.donor_dict listing = mailroom.list_donors(donor_db) assert listing.startswith('Donors:\n') assert "Sheryl Sandberg" in listing assert "Satya Nadella" in listing assert len(listing.split('\n')) == 6
def test_list_donors(): donor_db = mr.get_donor_db() listing = mr.list_donors() # hard to test this throughly -- better not to hard code the entire # thing. But check for a few aspects -- this will catch the likely # errors print(repr(listing)) assert listing.startswith("\nDonor list:") assert "Jeff Bezos" in listing assert "William Gates III" in listing assert len(listing.split('\n')) == 6
def test_list_donors(): donor_list = mailroom.list_donors() assert 'John Lennon' and 'Ringo Starr' in donor_list
def test_list_donors(self): self.assertEqual( list_donors(), 'Harry Potter\nRonald Weasley\nHermione Granger\nDraco Malfoy\nNeville Longbottom\nAlbus Dumbledore' )
def test_list_donors_empty_db(): db = {} res_string = "" assert list_donors(db) == res_string
def test_list_donors(): assert list_donors().strip() == "---------- Donors ----------\nBill Ted\nFrank Fred\nLaura Todd\nSteve Lincoln\nLisa Grant"
def test_list_donors_one_item_in_db(): db = {"one": [1, 2, 3]} res_string = " one" assert list_donors(db) == res_string
def test_list_donors_multiple_items_in_db(): db = {"one": [1, 2, 3], "two": [4, 5, 6], "three": [7, 8, 9]} res_string = " one\n two\n three" assert list_donors(db) == res_string
def test_list_donors(): assert m.list_donors() is True
def test_list_donors(): expected = 'Carmelo Anthony\nDamien Lillard\nCJ McCollum\nHassan Whiteside\nTerry Stotts' assert expected == mailroom.list_donors()
def test_list_donors_empty_value_lists(): db = {"one": [], "two": [], "three": []} res_string = " one\n two\n three" assert list_donors(db) == res_string