From 01be00f60063603050a8c8cae30db442ccd546b8 Mon Sep 17 00:00:00 2001 From: Christian Wendt Date: Thu, 8 Sep 2022 16:19:54 +0000 Subject: [PATCH] Fix FB Playoff Field --- espn_api/football/box_score.py | 2 +- espn_api/football/matchup.py | 2 +- tests/football/integration/test_league.py | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/espn_api/football/box_score.py b/espn_api/football/box_score.py index 1bf4648f..e5e4384d 100644 --- a/espn_api/football/box_score.py +++ b/espn_api/football/box_score.py @@ -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 diff --git a/espn_api/football/matchup.py b/espn_api/football/matchup.py index 316667dc..9caaa182 100644 --- a/espn_api/football/matchup.py +++ b/espn_api/football/matchup.py @@ -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 diff --git a/tests/football/integration/test_league.py b/tests/football/integration/test_league.py index b2125eee..d9a89316 100644 --- a/tests/football/integration/test_league.py +++ b/tests/football/integration/test_league.py @@ -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)