Example #1
0
    def test_roster_class_string_representation(self, *args, **kwargs):
        expected = """David Blough (david-blough-1)
David Blough (rondale-moore-1)"""

        flexmock(utils) \
            .should_receive('_find_year_for_season') \
            .and_return('2018')
        roster = Roster('PURDUE')

        assert roster.__repr__() == expected
Example #2
0
    def test_roster_class_pulls_all_player_stats(self, *args, **kwargs):
        flexmock(utils) \
            .should_receive('_find_year_for_season') \
            .and_return('2018')
        roster = Roster('PURDUE')

        assert len(roster.players) == 2

        for player in roster.players:
            assert player.name in ['David Blough', 'Rondale Moore']
Example #3
0
    def test_invalid_default_year_reverts_to_previous_year(
            self, *args, **kwargs):
        flexmock(utils) \
            .should_receive('_find_year_for_season') \
            .and_return('2019')

        roster = Roster('PURDUE')

        assert len(roster.players) == 2
        for player in roster.players:
            assert player.name in ['David Blough', 'Rondale Moore']
Example #4
0
    def test_roster_class_with_slim_parameter(self, *args, **kwargs):
        flexmock(utils) \
            .should_receive('_find_year_for_season') \
            .and_return('2018')
        roster = Roster('PURDUE', slim=True)

        assert len(roster.players) == 2
        assert roster.players == {
            'david-blough-1': 'David Blough',
            'rondale-moore-1': 'Rondale Moore'
        }
Example #5
0
 def test_bad_url_raises_value_error(self, *args, **kwargs):
     with pytest.raises(ValueError):
         roster = Roster('BAD')
Example #6
0
 def test_coach(self):
     assert "Troy Calhoun" == Roster('air-force', year=YEAR).coach