Skip to content

Commit

Permalink
Add test for empty overview and players
Browse files Browse the repository at this point in the history
  • Loading branch information
panzarino committed Aug 22, 2017
1 parent ae209bf commit b53512b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/test_game.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,10 @@ def test_overview(self):
self.assertEqual(overview.venue_w_chan_loc, 'USNY0504')
self.assertEqual(overview.wrapup_link, '/mlb/gameday/index.jsp?gid=2016_08_02_nyamlb_nynmlb_1&mode=wrap&c_id=mlb')

def test_overview_empty(self):
self.assertRaises(ValueError, lambda: mlbgame.overview('game_id'))
self.assertRaises(ValueError, lambda: mlbgame.overview('2016_08_02_nymlb_nymlb_1'))

def test_players(self):
players = mlbgame.players('2016_08_02_nyamlb_nynmlb_1')
coaches = players.home_coaches + players.away_coaches
Expand Down Expand Up @@ -311,3 +315,7 @@ def test_players(self):
self.assertEqual(ump.last, 'Gorman')
self.assertEqual(ump.name, 'Brian Gorman')
self.assertEqual(ump.position, 'home')

def test_players_empty(self):
self.assertRaises(ValueError, lambda: mlbgame.players('game_id'))
self.assertRaises(ValueError, lambda: mlbgame.players('2016_08_02_nymlb_nymlb_1'))

0 comments on commit b53512b

Please sign in to comment.