# Path: auv_control_pi/motors.py
# def _calculate_value_in_range(min_val, max_val, percentage):
#     """Get the value within a range based on percentage.
# 
#     Example:
#         A percentage 0.0 maps to min_val
#         A percentage of 1.0 maps to max_val
#     """
#     value_range = max_val - min_val
#     return min_val + int(percentage * value_range)


from ..motors import _calculate_value_in_range


def test_calculate_value_in_range_min():
    result = _calculate_value_in_range(
        min_val=1525,
        max_val=1900,
        percentage=0,
    )
    assert result == 1525


def test_calculate_value_in_range_mid():
    result = _calculate_value_in_range(
        min_val=1525,
        max_val=1900,
        percentage=0.5,
    )
    assert result == 1525 + (1900 - 1525) // 2


def test_calculate_value_in_range_neg_max():
    result = _calculate_value_in_range(
        min_val=1475,
        max_val=1100,
        percentage=1,
    )
    assert result == 1100


def test_calculate_value_in_range_neg_min():

# Path: auv_control_pi/motors.py
# def _calculate_value_in_range(min_val, max_val, percentage):
#     """Get the value within a range based on percentage.
# 
#     Example:
#         A percentage 0.0 maps to min_val
#         A percentage of 1.0 maps to max_val
#     """
#     value_range = max_val - min_val
#     return min_val + int(percentage * value_range)


# Path: auv_control_pi/tests/test_motors.py
from ..motors import _calculate_value_in_range



def test_calculate_value_in_range_min():
    result = _calculate_value_in_range(
        min_val=1525,
        max_val=1900,
        percentage=0,
    )
    assert result == 1525


def test_calculate_value_in_range_mid():
    result = _calculate_value_in_range(
        min_val=1525,
        max_val=1900,
        percentage=0.5,
    )
    assert result == 1525 + (1900 - 1525) // 2


def test_calculate_value_in_range_neg_max():
    result = _calculate_value_in_range(
        min_val=1475,
        max_val=1100,
        percentage=1,
    )
    assert result == 1100


def test_calculate_value_in_range_neg_min():

    result = _calculate_value_in_range(