dnd/deadsands/test/test_jobs.py

22 lines
426 B
Python
Raw Normal View History

2023-09-01 18:41:19 -07:00
import pytest
from site_tools import jobs
@pytest.mark.parametrize('value, step, expected', [
(0, 50, 50),
(49, 50, 50),
(51, 50, 50),
(99, 50, 100),
(100, 50, 100),
(101, 50, 100),
(124, 50, 100),
(125, 50, 100),
(126, 50, 150),
(150, 50, 150),
(151, 50, 150),
(199, 50, 200)
])
def test_nearest(value, step, expected):
assert jobs.nearest(value, step=step) == expected