Skip to content

Commit

Permalink
fix tests for python 3
Browse files Browse the repository at this point in the history
  • Loading branch information
panzarino committed Aug 24, 2017
1 parent 4ad8317 commit d3311f1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/test_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ def test_game_events(self):
events = mlbgame.game_events('2016_08_02_nyamlb_nynmlb_1')
for inning in events:
self.assertIsInstance(inning.num, int)
if inning.num == 1:
i = inning
self.assertIsInstance(inning.top, list)
self.assertIsInstance(inning.bottom, list)
atbats = inning.top + inning.bottom
for atbat in atbats:
if inning.num == 1 and atbat.num == 1:
ab = atbat
self.assertIsInstance(atbat.away_team_runs, int)
self.assertIsInstance(atbat.b, int)
self.assertIsInstance(atbat.b1, (int, str))
Expand Down Expand Up @@ -51,10 +55,10 @@ def test_game_events(self):
self.assertIsInstance(pitch.start_speed, float)
self.assertIsInstance(pitch.sv_id, str)
self.assertIsInstance(pitch.type, str)
inning = events[0]
inning = i
self.assertEqual(inning.num, 1)
self.assertEqual(inning.__str__(), 'Inning 1')
atbat = inning.top[0]
atbat = ab
self.assertEqual(atbat.away_team_runs, 0)
self.assertEqual(atbat.b, 1)
self.assertEqual(atbat.b1, '')
Expand Down

0 comments on commit d3311f1

Please sign in to comment.