@@ -9,44 +9,15 @@ class TestHittingStats(unittest.TestCase):
99 def setUpClass (cls ) -> None :
1010 cls .mlb = Mlb ()
1111 cls .al_team = 133
12- cls .shoei_ohtani = 660271
1312 cls .ty_france = 664034
14- cls .shoei_game_id = 531368
1513 cls .ty_game_id = 715757
1614 cls .cal_realeigh = 663728
1715 cls .cal_game_id = 715757
18- cls .archie_bradley = 605151
19- cls .archie_game_id = 531368
2016
2117 @classmethod
2218 def tearDownClass (cls ) -> None :
2319 pass
2420
25-
26- def test_get_players_stats_for_shoei_ohtana (self ):
27- """return player stat objects"""
28-
29- game_stats = self .mlb .get_players_stats_for_game (person_id = self .shoei_ohtani ,
30- game_id = self .shoei_game_id )
31-
32- # game stats should not be None
33- self .assertIsNotNone (game_stats )
34-
35- # game_stats should be a dict
36- self .assertIsInstance (game_stats , dict )
37-
38- print (game_stats )
39- # game_stats should have hitting stats
40- self .assertTrue (game_stats ['pitching' ])
41-
42- # game_stats should have vsplayer5y and playlog stats
43- self .assertTrue (game_stats ['pitching' ]['vsplayer5y' ])
44-
45- stat = game_stats ['pitching' ]['vsplayer5y' ]
46-
47- for split in stat .splits :
48- self .assertTrue (split .team )
49- self .assertTrue (split .stat )
5021
5122 def test_get_players_stats_for_ty_france (self ):
5223 """return player stat objects"""
@@ -94,32 +65,5 @@ def test_get_players_stats_for_cal_r(self):
9465 self .assertTrue (game_stats ['hitting' ]['playlog' ])
9566 self .assertTrue (game_stats ['stats' ]['gamelog' ])
9667
97- stat = game_stats ['stats' ]['gamelog' ]
98-
99-
100- def test_get_players_stats_for_archie (self ):
101- """return player stat objects"""
102-
103- self .game_stats = self .mlb .get_players_stats_for_game (person_id = self .archie_bradley ,
104- game_id = self .archie_game_id )
105-
106- # game stats should not be None
107- self .assertIsNotNone (self .game_stats )
10868
109- # game_stats should be a dict
110- self .assertIsInstance (self .game_stats , dict )
11169
112- # game_stats should have hitting stats
113- self .assertTrue (self .game_stats ['pitching' ])
114-
115- # game_stats should have vsplayer5y and playlog stats
116- self .assertTrue (self .game_stats ['pitching' ]['vsplayer5y' ])
117- self .assertTrue (self .game_stats ['stats' ]['gamelog' ])
118-
119- game_log_stat = self .game_stats ['stats' ]['gamelog' ]
120- self .assertTrue (len (game_log_stat .splits ) == 3 )
121- stat = self .game_stats ['pitching' ]['vsplayer5y' ]
122-
123- for split in stat .splits :
124- self .assertTrue (split .team )
125- self .assertTrue (split .stat )
0 commit comments