staking-deposit-cli/tests/test_utils/test_constants.py

19 lines
535 B
Python
Raw Normal View History

2021-04-12 10:31:04 +00:00
import pytest
from typing import (
Dict,
List,
)
2021-08-23 10:33:04 +00:00
from staking_deposit.utils.constants import _add_index_to_options
2021-04-12 10:31:04 +00:00
@pytest.mark.parametrize(
'arg, test', [
({'en': ['English', 'en']}, {'en': ['1. English', '1', 'English', 'en']}),
2021-04-12 10:38:24 +00:00
({'a': ['a'], 'b': ['b'], 'c': ['c']},
{'a': ['1. a', '1', 'a'], 'b': ['2. b', '2', 'b'], 'c': ['3. c', '3', 'c']})
2021-04-12 10:31:04 +00:00
]
)
2021-04-12 10:38:24 +00:00
def test_add_index_to_options(arg: Dict[str, List[str]], test: Dict[str, List[str]]) -> None:
2021-04-12 10:31:04 +00:00
assert _add_index_to_options(arg) == test