fix split shuffle

This commit is contained in:
2025-03-17 04:31:01 -05:00
parent fb650a4086
commit f9f7081fc6
3 changed files with 21 additions and 7 deletions

View File

@@ -5,7 +5,7 @@ from src.models import KeypadSize
@pytest.fixture()
def user_keypad():
return UserKeypad.create(keypad_size=KeypadSize(props_per_key=8, numb_of_keys=8))
return UserKeypad.create(keypad_size=KeypadSize(props_per_key=5, numb_of_keys=5))
def test_dispersion(user_keypad):
@@ -25,8 +25,11 @@ def test_shuffle_props(user_keypad):
- the order in which the cipher move from key to key is random (i.e. the distance traveled is uniform)
"""
pre_shuffle_keypad = user_keypad.keypad.copy()
print("")
print(user_keypad.keypad_matrix())
user_keypad.split_shuffle()
post_shuffle_keypad = user_keypad.keypad.copy()
print(user_keypad.keypad_matrix())
assert (not all(
post_shuffle_keypad[idx] == pre_shuffle_keypad[idx] for idx in range(len(post_shuffle_keypad))
))