Skip to content

Commit

Permalink
add client tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jbradley committed Sep 8, 2016
1 parent eebd021 commit 687d162
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/test_client.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,33 @@
from unittest import TestCase, skip

from stats.data.season import Season
from stats.client.client import Client
from stats.data.advanced_box_score import AdvancedBoxScore
from stats.data.player import Player
from stats.data.player_details import PlayerDetails
from stats.data.team import Team
from stats.data.game import Game


@skip("skip non-local testing")
class TestClient(TestCase):
def test_get_players_for_season(self):
players = Client.get_players_for_season(season=Season.season_2015)
self.assertIsNotNone(players)
self.assertEqual(len(players), 2000)
self.assertIsInstance(players[0], Player)

def test_get_games_for_team(self):
games = Client.get_games_for_team(season=Season.season_2015, team=Team.boston_celtics)
self.assertIsNotNone(games)
self.assertEqual(len(games), 82)
self.assertIsInstance(games[0], Game)

def test_get_player_info(self):
player_details = Client.get_player_info(player_id=201566)
self.assertIsNotNone(player_details)
self.assertIsInstance(player_details, PlayerDetails)

def test_get_advanced_box_score(self):
advanced_box_score = Client.get_advanced_box_score(game_id="0021501205")
self.assertIsNotNone(advanced_box_score)
Expand Down

0 comments on commit 687d162

Please sign in to comment.