# Path: nba_data/deserializers/utils/advanced_box_score_deserializer_utils.py
# class AdvancedBoxScoreDeserializerUtils:
# 
#     default_decimal_value = Decimal("0.0")
# 
#     def __init__(self):
#         pass
# 
#     @staticmethod
#     def parse_float(float_value):
#         if float_value is None:
#             return AdvancedBoxScoreDeserializerUtils.default_decimal_value
# 
#         if not isinstance(float_value, float):
#             raise ValueError("Expected a float instead of %s", float_value)
# 
#         return Decimal(Decimal(float_value).quantize(Decimal(".1"), rounding=ROUND_HALF_UP))
# 
#     @staticmethod
#     def parse_percentage(percentage):
#         if percentage is None:
#             return AdvancedBoxScoreDeserializerUtils.default_decimal_value
# 
#         if not isinstance(percentage, float):
#             raise ValueError("Expected a float instead of %s", percentage)
# 
#         return Decimal((100 * Decimal(percentage)).quantize(Decimal(".1"), rounding=ROUND_HALF_UP))


from decimal import Decimal
from unittest import TestCase
from nba_data.deserializers.utils.advanced_box_score_deserializer_utils import AdvancedBoxScoreDeserializerUtils



class TestAdvancedBoxScorePlayerStatsDeserializer(TestCase):

    def test_instantiation(self):
        self.assertIsNotNone(AdvancedBoxScoreDeserializerUtils())

    def test_parse_float(self):
        self.assertEqual(AdvancedBoxScoreDeserializerUtils.parse_float(None), Decimal("0.0"))
        self.assertRaises(ValueError, AdvancedBoxScoreDeserializerUtils.parse_float, "jae")

# Path: nba_data/deserializers/utils/advanced_box_score_deserializer_utils.py
# class AdvancedBoxScoreDeserializerUtils:
# 
#     default_decimal_value = Decimal("0.0")
# 
#     def __init__(self):
#         pass
# 
#     @staticmethod
#     def parse_float(float_value):
#         if float_value is None:
#             return AdvancedBoxScoreDeserializerUtils.default_decimal_value
# 
#         if not isinstance(float_value, float):
#             raise ValueError("Expected a float instead of %s", float_value)
# 
#         return Decimal(Decimal(float_value).quantize(Decimal(".1"), rounding=ROUND_HALF_UP))
# 
#     @staticmethod
#     def parse_percentage(percentage):
#         if percentage is None:
#             return AdvancedBoxScoreDeserializerUtils.default_decimal_value
# 
#         if not isinstance(percentage, float):
#             raise ValueError("Expected a float instead of %s", percentage)
# 
#         return Decimal((100 * Decimal(percentage)).quantize(Decimal(".1"), rounding=ROUND_HALF_UP))


# Path: tests/test_advancedBoxScoreDeserializerUtils.py
from decimal import Decimal
from unittest import TestCase
from nba_data.deserializers.utils.advanced_box_score_deserializer_utils import AdvancedBoxScoreDeserializerUtils




class TestAdvancedBoxScorePlayerStatsDeserializer(TestCase):

    def test_instantiation(self):
        self.assertIsNotNone(AdvancedBoxScoreDeserializerUtils())

    def test_parse_float(self):
        self.assertEqual(AdvancedBoxScoreDeserializerUtils.parse_float(None), Decimal("0.0"))
        self.assertRaises(ValueError, AdvancedBoxScoreDeserializerUtils.parse_float, "jae")

        self.assertEqual(AdvancedBoxScoreDeserializerUtils.parse_float(1.50), Decimal("1.5"))