# Path: nba_data/data/box_scores.py
# class GameBoxScore:
#     def __init__(self, game_id, player_box_scores, team_box_scores):
#         self.game_id = game_id
#         self.player_box_scores = player_box_scores
#         self.team_box_scores = team_box_scores
# 
# class TraditionalPlayerBoxScore(TraditionalBoxScore):
#     def __init__(self, player, seconds_played, field_goals_made, field_goals_attempted,
#                  three_point_field_goals_made, three_point_field_goals_attempted,
#                  free_throws_made, free_throws_attempted, offensive_rebounds, defensive_rebounds, assists,
#                  steals, blocks, turnovers, personal_fouls, plus_minus):
#         self.player = player
#         self.plus_minus = plus_minus
#         TraditionalBoxScore.__init__(self, seconds_played=seconds_played, field_goals_made=field_goals_made,
#                                      field_goals_attempted=field_goals_attempted,
#                                      three_point_field_goals_made=three_point_field_goals_made,
#                                      three_point_field_goals_attempted=three_point_field_goals_attempted,
#                                      free_throws_made=free_throws_made, free_throws_attempted=free_throws_attempted,
#                                      offensive_rebounds=offensive_rebounds, defensive_rebounds=defensive_rebounds,
#                                      assists=assists, steals=steals, blocks=blocks, turnovers=turnovers,
#                                      personal_fouls=personal_fouls)
# 
#     def get_additional_unicode(self):
#         return 'player: {player} | plus minus: {plus_minus}'.format(player=self.player, plus_minus=self.plus_minus)
# 
# class TraditionalTeamBoxScore(TraditionalBoxScore):
#     def __init__(self, team, seconds_played, field_goals_made, field_goals_attempted, free_throws_attempted,
#                  three_point_field_goals_made, three_point_field_goals_attempted,
#                  free_throws_made, offensive_rebounds, defensive_rebounds, assists,
#                  steals, blocks, turnovers, personal_fouls):
#         self.team = team
#         TraditionalBoxScore.__init__(self, seconds_played=seconds_played, field_goals_made=field_goals_made,
#                                      field_goals_attempted=field_goals_attempted,
#                                      three_point_field_goals_made=three_point_field_goals_made,
#                                      three_point_field_goals_attempted=three_point_field_goals_attempted,
#                                      free_throws_made=free_throws_made, free_throws_attempted=free_throws_attempted,
#                                      offensive_rebounds=offensive_rebounds, defensive_rebounds=defensive_rebounds,
#                                      assists=assists, steals=steals, blocks=blocks, turnovers=turnovers,
#                                      personal_fouls=personal_fouls)
# 
#     def get_additional_unicode(self):
#         return 'team: {team}'.format(self.team)
# 
# Path: nba_data/deserializers/box_scores/game.py
# class TraditionalGameBoxScoreDeserializer(BoxScoreDeserializer):
# 
#     def team_box_scores_deserializer(self, data):
#         return TraditionalTeamBoxScoresDeserializer.deserialize(data=data)
# 
#     def player_box_scores_deserializer(self, data):
#         return TraditionalPlayerBoxScoresDeserializer.deserialize(data=data)
# 
# Path: tests/config.py
# ROOT_DIRECTORY = root_path = os.path.dirname(os.path.dirname(__file__))


import json
import os
from unittest import TestCase
from nba_data.data.box_scores import GameBoxScore, TraditionalPlayerBoxScore, TraditionalTeamBoxScore
from nba_data.deserializers.box_scores.game import TraditionalGameBoxScoreDeserializer
from tests.config import ROOT_DIRECTORY



class TestTraditionalBoxScoreDeserializer(TestCase):
    def test_instantiation(self):
        self.assertIsNotNone(TraditionalGameBoxScoreDeserializer())

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

# Path: nba_data/data/box_scores.py
# class GameBoxScore:
#     def __init__(self, game_id, player_box_scores, team_box_scores):
#         self.game_id = game_id
#         self.player_box_scores = player_box_scores
#         self.team_box_scores = team_box_scores
# 
# class TraditionalPlayerBoxScore(TraditionalBoxScore):
#     def __init__(self, player, seconds_played, field_goals_made, field_goals_attempted,
#                  three_point_field_goals_made, three_point_field_goals_attempted,
#                  free_throws_made, free_throws_attempted, offensive_rebounds, defensive_rebounds, assists,
#                  steals, blocks, turnovers, personal_fouls, plus_minus):
#         self.player = player
#         self.plus_minus = plus_minus
#         TraditionalBoxScore.__init__(self, seconds_played=seconds_played, field_goals_made=field_goals_made,
#                                      field_goals_attempted=field_goals_attempted,
#                                      three_point_field_goals_made=three_point_field_goals_made,
#                                      three_point_field_goals_attempted=three_point_field_goals_attempted,
#                                      free_throws_made=free_throws_made, free_throws_attempted=free_throws_attempted,
#                                      offensive_rebounds=offensive_rebounds, defensive_rebounds=defensive_rebounds,
#                                      assists=assists, steals=steals, blocks=blocks, turnovers=turnovers,
#                                      personal_fouls=personal_fouls)
# 
#     def get_additional_unicode(self):
#         return 'player: {player} | plus minus: {plus_minus}'.format(player=self.player, plus_minus=self.plus_minus)
# 
# class TraditionalTeamBoxScore(TraditionalBoxScore):
#     def __init__(self, team, seconds_played, field_goals_made, field_goals_attempted, free_throws_attempted,
#                  three_point_field_goals_made, three_point_field_goals_attempted,
#                  free_throws_made, offensive_rebounds, defensive_rebounds, assists,
#                  steals, blocks, turnovers, personal_fouls):
#         self.team = team
#         TraditionalBoxScore.__init__(self, seconds_played=seconds_played, field_goals_made=field_goals_made,
#                                      field_goals_attempted=field_goals_attempted,
#                                      three_point_field_goals_made=three_point_field_goals_made,
#                                      three_point_field_goals_attempted=three_point_field_goals_attempted,
#                                      free_throws_made=free_throws_made, free_throws_attempted=free_throws_attempted,
#                                      offensive_rebounds=offensive_rebounds, defensive_rebounds=defensive_rebounds,
#                                      assists=assists, steals=steals, blocks=blocks, turnovers=turnovers,
#                                      personal_fouls=personal_fouls)
# 
#     def get_additional_unicode(self):
#         return 'team: {team}'.format(self.team)
# 
# Path: nba_data/deserializers/box_scores/game.py
# class TraditionalGameBoxScoreDeserializer(BoxScoreDeserializer):
# 
#     def team_box_scores_deserializer(self, data):
#         return TraditionalTeamBoxScoresDeserializer.deserialize(data=data)
# 
#     def player_box_scores_deserializer(self, data):
#         return TraditionalPlayerBoxScoresDeserializer.deserialize(data=data)
# 
# Path: tests/config.py
# ROOT_DIRECTORY = root_path = os.path.dirname(os.path.dirname(__file__))


# Path: tests/test_traditionalBoxScoreDeserializer.py
import json
import os
from unittest import TestCase
from nba_data.data.box_scores import GameBoxScore, TraditionalPlayerBoxScore, TraditionalTeamBoxScore
from nba_data.deserializers.box_scores.game import TraditionalGameBoxScoreDeserializer
from tests.config import ROOT_DIRECTORY




class TestTraditionalBoxScoreDeserializer(TestCase):
    def test_instantiation(self):
        self.assertIsNotNone(TraditionalGameBoxScoreDeserializer())

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

            box_score = TraditionalGameBoxScoreDeserializer().deserialize(data=data)