# Path: mugen/utilities/conversion.py
# def float_to_fraction(float_var: float) -> Fraction:
# def time_to_seconds(time: TIME_FORMAT) -> float:
# def seconds_to_time_code(seconds: float) -> str:
# def hex_to_rgb(hex_value) -> List[int]:
# def color_to_hex_code(color):
# def convert_float_to_fraction(*variable_names: str):
# def convert_time_to_seconds(*variable_names: str):
# def convert_color_to_hex_code(*variable_names: str):
# 
# Path: mugen/utilities/general.py
# def check_if_ranges_overlap(a_start, a_end, b_start, b_end) -> bool:
# def fill_slices(slices: List[slice], length) -> List[slice]:
# def preprocess_args(func: Callable, variable_names: List[str]):
#     def wrapper(f, *a, **kw):


from fractions import Fraction
from mugen.utilities import conversion, general
import pytest


@pytest.mark.parametrize(
    "float_var, expected_fraction",
    [
        (0.5, Fraction(numerator=1, denominator=2)),
        (1 / 3, Fraction(numerator=1, denominator=3)),
        (5, Fraction(numerator=5, denominator=1)),
    ],
)
def test_float_to_fraction(float_var, expected_fraction):
    assert conversion.float_to_fraction(float_var) == expected_fraction


@pytest.mark.parametrize(
    "slices, length, expected_slices",
    [
        ([slice(1, 2)], 0, [slice(0, 1), slice(1, 2)]),
        ([slice(2, 3)], 2, [slice(0, 2), slice(2, 3)]),
        ([slice(0, 8)], 2, [slice(0, 8)]),
        ([slice(1, 3)], 5, [slice(0, 1), slice(1, 3), slice(3, 5)]),
        ([slice(0, 3), slice(3, 4)], 5, [slice(0, 3), slice(3, 4), slice(4, 5)]),
        (
            [slice(1, 3), slice(5, 7)],
            8,
            [slice(0, 1), slice(1, 3), slice(3, 5), slice(5, 7), slice(7, 8)],
        ),
    ],
)
def test_fill_slices(slices, length, expected_slices):

# Path: mugen/utilities/conversion.py
# def float_to_fraction(float_var: float) -> Fraction:
# def time_to_seconds(time: TIME_FORMAT) -> float:
# def seconds_to_time_code(seconds: float) -> str:
# def hex_to_rgb(hex_value) -> List[int]:
# def color_to_hex_code(color):
# def convert_float_to_fraction(*variable_names: str):
# def convert_time_to_seconds(*variable_names: str):
# def convert_color_to_hex_code(*variable_names: str):
# 
# Path: mugen/utilities/general.py
# def check_if_ranges_overlap(a_start, a_end, b_start, b_end) -> bool:
# def fill_slices(slices: List[slice], length) -> List[slice]:
# def preprocess_args(func: Callable, variable_names: List[str]):
#     def wrapper(f, *a, **kw):


# Path: tests/unit/utilities/test_general.py
from fractions import Fraction
from mugen.utilities import conversion, general
import pytest



@pytest.mark.parametrize(
    "float_var, expected_fraction",
    [
        (0.5, Fraction(numerator=1, denominator=2)),
        (1 / 3, Fraction(numerator=1, denominator=3)),
        (5, Fraction(numerator=5, denominator=1)),
    ],
)
def test_float_to_fraction(float_var, expected_fraction):
    assert conversion.float_to_fraction(float_var) == expected_fraction


@pytest.mark.parametrize(
    "slices, length, expected_slices",
    [
        ([slice(1, 2)], 0, [slice(0, 1), slice(1, 2)]),
        ([slice(2, 3)], 2, [slice(0, 2), slice(2, 3)]),
        ([slice(0, 8)], 2, [slice(0, 8)]),
        ([slice(1, 3)], 5, [slice(0, 1), slice(1, 3), slice(3, 5)]),
        ([slice(0, 3), slice(3, 4)], 5, [slice(0, 3), slice(3, 4), slice(4, 5)]),
        (
            [slice(1, 3), slice(5, 7)],
            8,
            [slice(0, 1), slice(1, 3), slice(3, 5), slice(5, 7), slice(7, 8)],
        ),
    ],
)
def test_fill_slices(slices, length, expected_slices):

    assert general.fill_slices(slices, length) == expected_slices