# Path: nba_data/data/player_status.py
# class PlayerStatusType(Enum):
#     active = 'active'
#     did_not_play = 'did not play'
#     did_not_dress = 'did not dress'
#     not_with_team = 'not with team'
# 
#     @staticmethod
#     def from_abbreviation(abbreviation):
#         player_status_type = player_status_type_abbreviation_map.get(abbreviation)
# 
#         if player_status_type is None:
#             raise ValueError('Unknown player status abbreviation: %s', abbreviation)
# 
#         return player_status_type
# 
# Path: nba_data/data/team.py
# class Team(BaseQueryParameter, Enum):
#     atlanta_hawks = "Atlanta Hawks"
#     boston_celtics = "Boston Celtics"
#     brooklyn_nets = "Brooklyn Nets"
#     charlotte_hornets = "Charlotte Hornets"
#     chicago_bulls = "Chicago Bulls"
#     cleveland_cavaliers = "Cleveland Cavaliers"
#     dallas_mavericks = "Dallas Mavericks"
#     denver_nuggets = "Denver Nuggets"
#     detroit_pistons = "Detroit Pistons"
#     golden_state_warriors = "Golden State Warriors"
#     houston_rockets = "Houston Rockets"
#     indiana_pacers = "Indiana Pacers"
#     los_angeles_clippers = "Los Angeles Clippers"
#     los_angeles_lakers = "Los Angeles Lakers"
#     memphis_grizzlies = "Memphis Grizzlies"
#     miami_heat = "Miami Heat"
#     milwaukee_bucks = "Milwaukee Bucks"
#     minnesota_timberwolves = "Minnesota Timberwolves"
#     new_orleans_pelicans = "New Orleans Pelicans"
#     new_york_knicks = "New York Knicks"
#     oklahoma_city_thunder = "Oklahoma City Thunder"
#     orlando_magic = "Orlando Magic"
#     philadelphia_76ers = "Philadelphia 76ers"
#     phoenix_suns = "Phoenix Suns"
#     portland_trail_blazers = "Portland Trail Blazers"
#     sacramento_kings = "Sacramento Kings"
#     san_antonio_spurs = "San Antonio Spurs"
#     toronto_raptors = "Toronto Raptors"
#     utah_jazz = "Utah Jazz"
#     washington_wizards = "Washington Wizards"
# 
#     @staticmethod
#     def get_query_parameter_name():
#         return "TeamId"
# 
#     @staticmethod
#     def get_team_by_id(team_id):
#         assert isinstance(team_id, int)
# 
#         return team_id_map.get(team_id)
# 
#     @staticmethod
#     def get_id(team):
#         assert isinstance(team, Team)
# 
#         return team_to_id_map.get(team)
# 
#     @staticmethod
#     def get_team_by_abbreviation(abbreviation):
#         assert isinstance(abbreviation, basestring)
# 
#         team = team_abbreviation_map.get(abbreviation.upper())
# 
#         if team is None:
#             raise ValueError('Unknown team abbreviation: %s', abbreviation)
# 
#         return team_abbreviation_map.get(abbreviation.upper())
# 
#     @staticmethod
#     def get_team_by_name(name):
#         assert isinstance(name, basestring)
# 
#         team = team_name_map.get(name)
# 
#         if team is None:
#             raise ValueError('Unknown team name: %s', name)
# 
#         return team
# 
# Path: nba_data/deserializers/box_scores/game.py
# class AdvancedGameBoxScoreDeserializer(BoxScoreDeserializer):
# 
#     def player_box_scores_deserializer(self, data):
#         return AdvancedPlayerBoxScoresDeserializer.deserialize(data=data)
# 
#     def team_box_scores_deserializer(self, data):
#         return AdvancedTeamBoxScoresDeserializer.deserialize(data=data)
# 
# Path: tests/config.py
# ROOT_DIRECTORY = root_path = os.path.dirname(os.path.dirname(__file__))


import json
import os
from decimal import Decimal
from unittest import TestCase
from nba_data.data.player_status import PlayerStatusType
from nba_data.data.team import Team
from nba_data.deserializers.box_scores.game import AdvancedGameBoxScoreDeserializer
from tests.config import ROOT_DIRECTORY



class TestAdvancedBoxScoreDeserializer(TestCase):
    def test_instantiation(self):
        self.assertIsNotNone(AdvancedGameBoxScoreDeserializer())

    def test_deserialize_advanced_box_score(self):
        with open(os.path.join(ROOT_DIRECTORY, 'tests/files/boxscoreadvanced.json')) as data_file:
            data = json.load(data_file)

# Path: nba_data/data/player_status.py
# class PlayerStatusType(Enum):
#     active = 'active'
#     did_not_play = 'did not play'
#     did_not_dress = 'did not dress'
#     not_with_team = 'not with team'
# 
#     @staticmethod
#     def from_abbreviation(abbreviation):
#         player_status_type = player_status_type_abbreviation_map.get(abbreviation)
# 
#         if player_status_type is None:
#             raise ValueError('Unknown player status abbreviation: %s', abbreviation)
# 
#         return player_status_type
# 
# Path: nba_data/data/team.py
# class Team(BaseQueryParameter, Enum):
#     atlanta_hawks = "Atlanta Hawks"
#     boston_celtics = "Boston Celtics"
#     brooklyn_nets = "Brooklyn Nets"
#     charlotte_hornets = "Charlotte Hornets"
#     chicago_bulls = "Chicago Bulls"
#     cleveland_cavaliers = "Cleveland Cavaliers"
#     dallas_mavericks = "Dallas Mavericks"
#     denver_nuggets = "Denver Nuggets"
#     detroit_pistons = "Detroit Pistons"
#     golden_state_warriors = "Golden State Warriors"
#     houston_rockets = "Houston Rockets"
#     indiana_pacers = "Indiana Pacers"
#     los_angeles_clippers = "Los Angeles Clippers"
#     los_angeles_lakers = "Los Angeles Lakers"
#     memphis_grizzlies = "Memphis Grizzlies"
#     miami_heat = "Miami Heat"
#     milwaukee_bucks = "Milwaukee Bucks"
#     minnesota_timberwolves = "Minnesota Timberwolves"
#     new_orleans_pelicans = "New Orleans Pelicans"
#     new_york_knicks = "New York Knicks"
#     oklahoma_city_thunder = "Oklahoma City Thunder"
#     orlando_magic = "Orlando Magic"
#     philadelphia_76ers = "Philadelphia 76ers"
#     phoenix_suns = "Phoenix Suns"
#     portland_trail_blazers = "Portland Trail Blazers"
#     sacramento_kings = "Sacramento Kings"
#     san_antonio_spurs = "San Antonio Spurs"
#     toronto_raptors = "Toronto Raptors"
#     utah_jazz = "Utah Jazz"
#     washington_wizards = "Washington Wizards"
# 
#     @staticmethod
#     def get_query_parameter_name():
#         return "TeamId"
# 
#     @staticmethod
#     def get_team_by_id(team_id):
#         assert isinstance(team_id, int)
# 
#         return team_id_map.get(team_id)
# 
#     @staticmethod
#     def get_id(team):
#         assert isinstance(team, Team)
# 
#         return team_to_id_map.get(team)
# 
#     @staticmethod
#     def get_team_by_abbreviation(abbreviation):
#         assert isinstance(abbreviation, basestring)
# 
#         team = team_abbreviation_map.get(abbreviation.upper())
# 
#         if team is None:
#             raise ValueError('Unknown team abbreviation: %s', abbreviation)
# 
#         return team_abbreviation_map.get(abbreviation.upper())
# 
#     @staticmethod
#     def get_team_by_name(name):
#         assert isinstance(name, basestring)
# 
#         team = team_name_map.get(name)
# 
#         if team is None:
#             raise ValueError('Unknown team name: %s', name)
# 
#         return team
# 
# Path: nba_data/deserializers/box_scores/game.py
# class AdvancedGameBoxScoreDeserializer(BoxScoreDeserializer):
# 
#     def player_box_scores_deserializer(self, data):
#         return AdvancedPlayerBoxScoresDeserializer.deserialize(data=data)
# 
#     def team_box_scores_deserializer(self, data):
#         return AdvancedTeamBoxScoresDeserializer.deserialize(data=data)
# 
# Path: tests/config.py
# ROOT_DIRECTORY = root_path = os.path.dirname(os.path.dirname(__file__))


# Path: tests/test_advancedBoxScoreDeserializer.py
import json
import os
from decimal import Decimal
from unittest import TestCase
from nba_data.data.player_status import PlayerStatusType
from nba_data.data.team import Team
from nba_data.deserializers.box_scores.game import AdvancedGameBoxScoreDeserializer
from tests.config import ROOT_DIRECTORY




class TestAdvancedBoxScoreDeserializer(TestCase):
    def test_instantiation(self):
        self.assertIsNotNone(AdvancedGameBoxScoreDeserializer())

    def test_deserialize_advanced_box_score(self):
        with open(os.path.join(ROOT_DIRECTORY, 'tests/files/boxscoreadvanced.json')) as data_file:
            data = json.load(data_file)

            advanced_box_score = AdvancedGameBoxScoreDeserializer().deserialize(data)