示例#1
0
def test_add_donor():
    # Test for existing donor
    mailroom.add_donor('John Jacob')
    assert mailroom.donors['John Jacob'] == [5.00, 1000.00, 4.25]

    # Test for new donor
    mailroom.add_donor('Emory')
    assert mailroom.donors['Emory'] == []
示例#2
0
def test_add_donor3():
    """Test if new donor is in database."""
    add_donor('kyle test')
    assert 'Kyle Test' in db.keys()
示例#3
0
def test_add_donor2():
    """Test check for existing donor name in database.  Message text."""
    assert add_donor('callum fuller') == ('Callum Fuller', '\nFound donor '
                                          'Callum Fuller in database.')
示例#4
0
def test_add_donor1():
    """Test addition of new donor to database.  Message text."""
    assert add_donor('kyle test') == ('Kyle Test',
                                      '\nAdding donor to database : Kyle Test')
示例#5
0
 def test_donor_exists(self):
     mailroom_pt4.add_donor("Michael Jordan", 200)
     self.assertListEqual(mailroom_pt4.donor_dict.get("Michael Jordan"), [1300, 200])
示例#6
0
 def test_add_donor(self):
     mailroom_pt4.add_donor("Billy Bob", 2345)
     self.assertEqual(mailroom_pt4.donor_dict.get("Billy Bob"), [2345])