예제 #1
0
def test_two(capsys):
    '''
    Testing the list functions
    '''

    mailroom.donor_list()
    captured = capsys.readouterr()
    assert "Robert Smith" in captured.out
    assert "JD Cronise" in captured.out
def test_list():
    actual = donor_list()
    expected = [
        'William Gates, III', 'Mark Zuckerberg', 'Jeff Bezos', 'Paul Allen'
    ]

    assert expected == actual
def test_donor_list():
    # make sure to start with a clean test set
    mr.donor_db = get_test_donors()

    listing = mr.donor_list()

    assert len(listing.split("\n")) == 4
    assert "Paul Allen" in listing
    assert "Jeff Bezos" in listing
예제 #4
0
    def test_donor_list(self, mocker, name_list, goal):
        """Positive-Test-Cases"""
        # Setup
        mocked_donation_data = {name: None for name in name_list}

        # Mock
        mocker.patch.object(mailroom, "donation_data", new=mocked_donation_data)

        # Execute & Assert
        assert mailroom.donor_list() == goal
예제 #5
0
def test_donor_list():
    donors = m.donor_list(test_donors)
    assert donors.startswith('Jeff Bezos')
    assert donors.endswith('Elmer Fudd\n')
예제 #6
0
def test_donor_list():
    """Testing the Donor List"""
    from mailroom import donor_list
    assert donor_list()
예제 #7
0
def test_donor_list(lst, choice, result):
    """Test for donor_list function."""
    from mailroom import donor_list
    assert donor_list(lst, choice) == result
예제 #8
0
def test_donor_list():
    donor_db = {"William": [653772.32, 12.17]}
    assert mailroom.donor_list(donor_db) == ['William']
예제 #9
0
 def test_1(self):
     self.assertEqual(donor_list({
         'Charlie': 100,
         'Carolyn': 100
     }), 'Charlie: 100\nCarolyn: 100')
예제 #10
0
def test_donor_list():
    from mailroom import donor_list
    assert len(donor_list()) > 0
    assert type(donor_list()) == list