Skip to content

Commit

Permalink
Merge pull request #356 from cwendt94/fix_fb_playoff
Browse files Browse the repository at this point in the history
Fix FB Playoff Field
  • Loading branch information
cwendt94 authored Sep 8, 2022
2 parents edae679 + 01be00f commit 39a0f4b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion espn_api/football/box_score.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class BoxScore(object):
''' '''
def __init__(self, data, pro_schedule, positional_rankings, week, year):
self.matchup_type = data.get('playoffTierType', 'NONE')
self.is_playoff = self.matchup_type != 'None'
self.is_playoff = self.matchup_type != 'NONE'

self.home_team = data['home']['teamId']
self.home_projected = -1 # week is over/not set
Expand Down
2 changes: 1 addition & 1 deletion espn_api/football/matchup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def _fetch_matchup_info(self):
self.home_team = self.data['home']['teamId']
self.home_score = self.data['home']['totalPoints']
self.matchup_type = self.data.get('playoffTierType', 'NONE')
self.is_playoff = self.matchup_type != 'None'
self.is_playoff = self.matchup_type != 'NONE'

# For Leagues with bye weeks
self.away_team = 0
Expand Down
4 changes: 4 additions & 0 deletions tests/football/integration/test_league.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ def test_box_scores(self):
self.assertEqual(repr(box_scores[1].away_team), 'Team(TEAM BERRY)')
self.assertEqual(repr(box_scores[1].away_lineup[1]), 'Player(Odell Beckham Jr., points:29.0, projected:16.72)')
self.assertEqual(repr(box_scores[1]), 'Box Score(Team(TEAM BERRY) at Team(TEAM HOLLAND))')
self.assertEqual(box_scores[0].is_playoff, False)

box_scores = league.box_scores()
self.assertEqual(box_scores[0].is_playoff, True)

def test_player_info(self):
league = League(48153503, 2019)
Expand Down

0 comments on commit 39a0f4b

Please sign in to comment.