Skip to content

Commit

Permalink
add mock for test
Browse files Browse the repository at this point in the history
  • Loading branch information
cwendt94 committed Sep 24, 2024
1 parent bbb8454 commit 7a54bdb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion espn_api/base_league.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def _get_pro_schedule(self, scoringPeriodId: int = None):
def _get_all_pro_schedule(self):
data = self.espn_request.get_pro_schedule()

pro_teams = data['settings']['proTeams']
pro_teams = data.get('settings', {}).get('proTeams', {})
pro_team_schedule = {}

for team in pro_teams:
Expand Down
1 change: 1 addition & 0 deletions tests/football/unit/test_league.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def mock_setUp(self, m):
m.get(self.espn_endpoint + '?view=mTeam&view=mRoster&view=mMatchup&view=mSettings', status_code=200, json=self.league_data)
m.get(self.espn_endpoint + '?view=mDraftDetail', status_code=200, json=self.draft_data)
m.get(self.players_endpoint, status_code=200, json=self.players_data)
m.get(self.espn_endpoint + '?view=proTeamSchedules_wl', status_code=200, json={})

@requests_mock.Mocker()
def test_error_status(self, m):
Expand Down

0 comments on commit 7a54bdb

Please sign in to comment.