source/projects/damm/test/python/test_damm.py

15 lines
332 B
Python
Raw Normal View History

2021-08-04 02:03:16 +00:00
from damm import Damm
import pytest
2021-08-04 06:17:20 +00:00
@pytest.mark.parametrize("num", [
2021-08-30 06:43:58 +00:00
"0", # 0 itself is the start Damm state
"37", # [0, 3] => 7
"92", # [0, 9] => 2
"1234", # Amusingly, this is a 0-product.
2021-08-04 02:03:16 +00:00
])
def test_num_verifies(num):
"""Assert that known-good Damm checks pass."""
assert Damm.verify(num)