# Path: clearly/utils/env_params.py
# TV = TypeVar('TV', str, int, List[str])
# def get_env_param(name: str, default: TV, factory: Callable[[str], TV]) -> TV:


from unittest import mock
from clearly.utils.env_params import get_env_int, get_env_int_tuple, get_env_tuple, get_env_param, \
    get_env_str
import pytest




def test_retrieve_correct_var():
    with mock.patch('os.getenv') as mocked_getenv:
        get_env_param('NAME', 1, int)
        mocked_getenv.assert_called_once_with('NAME')


@pytest.mark.parametrize('value, func, expected', [
    ('123', get_env_str, '123'),
    ('123', get_env_int, 123),
    ('123', get_env_tuple, ('123',)),
    ('123', get_env_int_tuple, (123,)),
    ('cool', get_env_str, 'cool'),
    ('cool', get_env_int, None),

# Path: clearly/utils/env_params.py
# TV = TypeVar('TV', str, int, List[str])
# def get_env_param(name: str, default: TV, factory: Callable[[str], TV]) -> TV:


# Path: tests/unit/utils/test_env_params.py
from unittest import mock
from clearly.utils.env_params import get_env_int, get_env_int_tuple, get_env_tuple, get_env_param, \
    get_env_str
import pytest





def test_retrieve_correct_var():
    with mock.patch('os.getenv') as mocked_getenv:
        get_env_param('NAME', 1, int)
        mocked_getenv.assert_called_once_with('NAME')


@pytest.mark.parametrize('value, func, expected', [
    ('123', get_env_str, '123'),
    ('123', get_env_int, 123),
    ('123', get_env_tuple, ('123',)),
    ('123', get_env_int_tuple, (123,)),
    ('cool', get_env_str, 'cool'),
    ('cool', get_env_int, None),

    ('cool', get_env_tuple, ('cool',)),