implement keypad size

This commit is contained in:
2024-07-19 10:39:05 -05:00
parent b37c17eca6
commit 65d78867ca
13 changed files with 198 additions and 191 deletions

View File

@@ -1,14 +1,15 @@
import pytest
from src.user_interface import UserInterface
from src.models import KeypadSize
@pytest.mark.parametrize(
"numb_of_keys,attrs_per_key",
[(10, 7,)]
"keypad_size",
[KeypadSize(numb_of_keys=10, attrs_per_key=7)]
)
def test_attr_set_idx(numb_of_keys, attrs_per_key):
user_interface = UserInterface.new(attrs_per_key, numb_of_keys)
def test_attr_set_idx(keypad_size):
user_interface = UserInterface.new(keypad_size)
for attr_idx in range(70):
user_interface_idx = user_interface.attr_indices[attr_idx]
assert (attr_idx % attrs_per_key == user_interface_idx % attrs_per_key)
assert (attr_idx % keypad_size.attrs_per_key == user_interface_idx % keypad_size.attrs_per_key)