|
| 1 | +from unittest import TestCase |
| 2 | + |
| 3 | +from basketball_reference_web_scraper import client |
| 4 | +from basketball_reference_web_scraper.data import Location, Team, Outcome |
| 5 | + |
| 6 | + |
| 7 | +class TestPlayerBoxScores(TestCase): |
| 8 | + def test(self): |
| 9 | + box_scores = client.player_box_scores(day=11, month=3, year=2024) |
| 10 | + self.assertIsNotNone(box_scores) |
| 11 | + self.assertNotEqual(0, len(box_scores)) |
| 12 | + self.assertEqual(124, len(box_scores)) |
| 13 | + self.assertEqual({ |
| 14 | + "name": "Nikola Jokić", |
| 15 | + "slug": "jokicni01", |
| 16 | + "team": Team.DENVER_NUGGETS, |
| 17 | + "opponent": Team.TORONTO_RAPTORS, |
| 18 | + "location": Location.HOME, |
| 19 | + "outcome": Outcome.WIN, |
| 20 | + "seconds_played": 2286, |
| 21 | + "made_field_goals": 14, |
| 22 | + "attempted_field_goals": 26, |
| 23 | + "made_three_point_field_goals": 1, |
| 24 | + "attempted_three_point_field_goals": 3, |
| 25 | + "made_free_throws": 6, |
| 26 | + "attempted_free_throws": 6, |
| 27 | + "offensive_rebounds": 6, |
| 28 | + "defensive_rebounds": 11, |
| 29 | + "assists": 12, |
| 30 | + "steals": 6, |
| 31 | + "blocks": 2, |
| 32 | + "turnovers": 2, |
| 33 | + "personal_fouls": 3, |
| 34 | + "game_score": 42.5, |
| 35 | + }, |
| 36 | + box_scores[0]) |
0 commit comments