# Path: nba_data/data/season.py
# class Season(BaseQueryParameter, Enum):
#     season_2016 = "2016-17"
#     season_2015 = "2015-16"
#     season_2014 = "2014-15"
#     season_2013 = "2013-14"
#     season_2012 = "2012-13"
#     season_2011 = "2011-12"
#     season_2010 = "2010-11"
#     season_2009 = "2009-10"
#     season_2008 = "2008-09"
#     season_2007 = "2007-08"
#     season_2006 = "2006-07"
#     season_2005 = "2005-06"
#     season_2004 = "2004-05"
#     season_2003 = "2003-04"
#     season_2002 = "2002-03"
#     season_2001 = "2001-02"
#     season_2000 = "2000-01"
#     season_1999 = "1999-00"
#     season_1998 = "1998-99"
#     season_1997 = "1997-98"
#     season_1996 = "1996-97"
#     season_1995 = "1995-96"
#     season_1994 = "1994-95"
#     season_1993 = "1993-94"
#     season_1992 = "1992-93"
#     season_1991 = "1991-92"
#     season_1990 = "1990-91"
# 
#     @staticmethod
#     def get_query_parameter_name():
#         return "Season"
# 
#     @staticmethod
#     def get_season_by_name(name):
#         season = season_name_map.get(name)
# 
#         if season is None:
#             raise ValueError("Unknown season name: %s", name)
# 
#         return season
# 
#     @staticmethod
#     def get_season_by_start_year(year):
#         season = start_year_to_season_map.get(year)
# 
#         if season is None:
#             raise ValueError("Unknown season start year: %s", year)
# 
#         return season
# 
#     @staticmethod
#     def get_season_by_end_year(year):
#         season = season_end_year_map.get(year)
# 
#         if season is None:
#             raise ValueError("Unknown season end year: %s", year)
# 
#         return season
# 
#     @staticmethod
#     def get_season_by_start_and_end_year(start_year, end_year):
#         start_year_season = Season.get_season_by_start_year(year=start_year)
#         end_year_season = Season.get_season_by_end_year(year=end_year)
# 
#         if start_year_season is not end_year_season:
#             raise ValueError("Cannot find season with start year: %s and end year: %s", start_year, end_year)
# 
#         return start_year_season
# 
#     @staticmethod
#     def get_start_year_by_season(season):
#         assert isinstance(season, Season)
# 
#         start_year = season_to_start_year_map.get(season)
# 
#         if start_year is None:
#             raise ValueError("Cannot find start year for season: %s", season)
# 
#         return start_year


from unittest import TestCase
from nba_data.data.season import Season



class TestSeason(TestCase):
    def test_get_query_parameter_name(self):
        self.assertEqual(Season.get_query_parameter_name(), "Season")

    def test_get_season_by_name(self):
        self.assertEqual(Season.get_season_by_name("2015-16"), Season.season_2015)
        self.assertRaises(ValueError, Season.get_season_by_name, "jae")

    def test_get_season_by_start_year(self):

# Path: nba_data/data/season.py
# class Season(BaseQueryParameter, Enum):
#     season_2016 = "2016-17"
#     season_2015 = "2015-16"
#     season_2014 = "2014-15"
#     season_2013 = "2013-14"
#     season_2012 = "2012-13"
#     season_2011 = "2011-12"
#     season_2010 = "2010-11"
#     season_2009 = "2009-10"
#     season_2008 = "2008-09"
#     season_2007 = "2007-08"
#     season_2006 = "2006-07"
#     season_2005 = "2005-06"
#     season_2004 = "2004-05"
#     season_2003 = "2003-04"
#     season_2002 = "2002-03"
#     season_2001 = "2001-02"
#     season_2000 = "2000-01"
#     season_1999 = "1999-00"
#     season_1998 = "1998-99"
#     season_1997 = "1997-98"
#     season_1996 = "1996-97"
#     season_1995 = "1995-96"
#     season_1994 = "1994-95"
#     season_1993 = "1993-94"
#     season_1992 = "1992-93"
#     season_1991 = "1991-92"
#     season_1990 = "1990-91"
# 
#     @staticmethod
#     def get_query_parameter_name():
#         return "Season"
# 
#     @staticmethod
#     def get_season_by_name(name):
#         season = season_name_map.get(name)
# 
#         if season is None:
#             raise ValueError("Unknown season name: %s", name)
# 
#         return season
# 
#     @staticmethod
#     def get_season_by_start_year(year):
#         season = start_year_to_season_map.get(year)
# 
#         if season is None:
#             raise ValueError("Unknown season start year: %s", year)
# 
#         return season
# 
#     @staticmethod
#     def get_season_by_end_year(year):
#         season = season_end_year_map.get(year)
# 
#         if season is None:
#             raise ValueError("Unknown season end year: %s", year)
# 
#         return season
# 
#     @staticmethod
#     def get_season_by_start_and_end_year(start_year, end_year):
#         start_year_season = Season.get_season_by_start_year(year=start_year)
#         end_year_season = Season.get_season_by_end_year(year=end_year)
# 
#         if start_year_season is not end_year_season:
#             raise ValueError("Cannot find season with start year: %s and end year: %s", start_year, end_year)
# 
#         return start_year_season
# 
#     @staticmethod
#     def get_start_year_by_season(season):
#         assert isinstance(season, Season)
# 
#         start_year = season_to_start_year_map.get(season)
# 
#         if start_year is None:
#             raise ValueError("Cannot find start year for season: %s", season)
# 
#         return start_year


# Path: tests/test_season.py
from unittest import TestCase
from nba_data.data.season import Season




class TestSeason(TestCase):
    def test_get_query_parameter_name(self):
        self.assertEqual(Season.get_query_parameter_name(), "Season")

    def test_get_season_by_name(self):
        self.assertEqual(Season.get_season_by_name("2015-16"), Season.season_2015)
        self.assertRaises(ValueError, Season.get_season_by_name, "jae")

    def test_get_season_by_start_year(self):

        self.assertEqual(Season.get_season_by_start_year(year=2016), Season.season_2016)