import pytest

from simulator.bake_right_variants import RIGHT_LEVELS, right_strength_params


def test_levels_are_one_through_four():
    assert RIGHT_LEVELS == (1, 2, 3, 4)


def test_strength_increases_with_level():
    keys = [right_strength_params(l)[0] for l in RIGHT_LEVELS]
    assert keys == sorted(keys)            # monotonic ramp
    assert keys[0] < keys[-1]              # subtle -> strong


def test_tween_strength_is_a_fraction_of_key_strength():
    for l in RIGHT_LEVELS:
        key, tween = right_strength_params(l)
        assert 0.0 < tween < key           # tween is a light refine only


def test_rejects_out_of_range_level():
    with pytest.raises(ValueError):
        right_strength_params(0)
    with pytest.raises(ValueError):
        right_strength_params(5)
