def test_list_donors(): dl = Donorlist(init_tuple) assert type(dl.list_donors()) == list assert dl.list_donors() == [ 'Burt Reynolds', 'John Waters', 'Nick Offerman', 'Sam Elliot', 'Tom Selleck' ]
def test_add_donor(): dl = Donorlist(init_tuple) dl.add_donor('Gene Shallit') assert 'Gene Shallit' in dl.list_donors() assert isinstance(dl.get_donor('Gene Shallit'), Donor) assert dl.list_donations('Gene Shallit') == [] with pytest.raises(ValueError): dl.add_donor('Tom Selleck')