Skip to content

Commit

Permalink
Merge pull request #376 from cwendt94/remove_start_date
Browse files Browse the repository at this point in the history
Remove start date from league class
  • Loading branch information
cwendt94 committed Oct 3, 2022
2 parents dbc5114 + 6b195ea commit 95a89ac
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 7 deletions.
1 change: 0 additions & 1 deletion espn_api/basketball/league.py
Expand Up @@ -28,7 +28,6 @@ def fetch_league(self):

def _fetch_league(self):
data = super()._fetch_league()
self.start_date = datetime.datetime.fromtimestamp(min([i[1][1]/1000 for i in self._get_pro_schedule(1).items()])).date()
self._fetch_players()
self._map_matchup_ids(data['schedule'])
return(data)
Expand Down
2 changes: 0 additions & 2 deletions espn_api/hockey/league.py
Expand Up @@ -26,8 +26,6 @@ def fetch_league(self):

def _fetch_league(self):
data = super()._fetch_league()
self.start_date = datetime.datetime.fromtimestamp(
min([i[1][1] / 1000 for i in self._get_pro_schedule(1).items()])).date()
self._fetch_players()
self._map_matchup_ids(data['schedule'])
return data
Expand Down
1 change: 0 additions & 1 deletion espn_api/wbasketball/league.py
Expand Up @@ -27,7 +27,6 @@ def fetch_league(self):

def _fetch_league(self):
data = super()._fetch_league()
self.start_date = datetime.datetime.fromtimestamp(min([i[1][1]/1000 for i in self._get_pro_schedule(1).items()])).date()
self._fetch_players()
self._map_matchup_ids(data['schedule'])
return(data)
Expand Down
5 changes: 2 additions & 3 deletions tests/hockey/integration/test_league.py
Expand Up @@ -8,9 +8,8 @@ class LeagueTest(TestCase):
def test_league_init(self):
league = League(77421173, 2021)

self.assertEqual(league.start_date.year, 2021)
self.assertEqual(league.start_date.month, 1)
self.assertEqual(league.start_date.day, 13)
self.assertEqual(league.teams[0].__repr__(), 'Team(Cambridge Bay Caribou)')
self.assertEqual(league.teams[1].roster[0].name, 'Steven Stamkos')

def test_blank_league_init(self):
blank_league = League(77421173, 2021, fetch_league=False)
Expand Down

0 comments on commit 95a89ac

Please sign in to comment.