File tree Expand file tree Collapse file tree
tests/external_tests/game Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -233,6 +233,22 @@ class CodeDesc:
233233 code : str
234234 description : Optional [str ] = None
235235
236+ @dataclass
237+ class Violation :
238+ """
239+
240+ Attributes
241+ ----------
242+ type : str
243+ the type of violation during the play
244+ description : str
245+ the description of the violation that occured
246+ player : player
247+ the player that caused the violation
248+ """
249+ type : Optional [str ] = None
250+ description : Optional [str ] = None
251+ player : Optional [dict ] = None
236252
237253@dataclass (repr = False )
238254class Count :
@@ -332,12 +348,14 @@ class PlayDetails:
332348 trailcolor : Optional [str ] = None
333349 fromcatcher : Optional [bool ] = None
334350 disengagementnum : Optional [int ] = None
351+ violation : Optional [Union [Violation , dict ]] = field (default_factory = dict )
335352
336353 def __post_init__ (self ):
337354 self .call = CodeDesc (** self .call ) if self .call else self .call
338355 self .batside = CodeDesc (** self .batside ) if self .batside else self .batside
339356 self .pitchhand = CodeDesc (** self .pitchhand ) if self .pitchhand else self .pitchhand
340357 self .type = CodeDesc (** self .type ) if self .type else self .type
358+ self .violation = Violation (** self .violation ) if self .violation else self .violation
341359
342360 def __repr__ (self ) -> str :
343361 kws = [f'{ key } ={ value } ' for key , value in self .__dict__ .items () if value is not None and value ]
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44
55[project ]
66name = " python-mlb-statsapi"
7- version = " 0.5.16 "
7+ version = " 0.5.17 "
88
99authors = [
1010 { name =" Matthew Spah" , email =" spahmatthew@gmail.com" },
Original file line number Diff line number Diff line change @@ -15,14 +15,14 @@ class TestGame(unittest.TestCase):
1515 @classmethod
1616 def setUpClass (cls ) -> None :
1717 cls .mlb = Mlb ()
18- cls .game = cls .mlb .get_game (662242 )
18+ cls .game = cls .mlb .get_game (717911 )
1919
2020 @classmethod
2121 def tearDownClass (cls ) -> None :
2222 pass
2323
2424 def test_game_creation (self ):
25- self .assertEqual (self .game .id , 662242 )
25+ self .assertEqual (self .game .id , 717911 )
2626 self .assertIsInstance (self .game , Game )
2727
2828 def test_game_attrs (self ):
You can’t perform that action at this time.
0 commit comments