File: test_output_correction.py

package info (click to toggle)
pyartnet 2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 668 kB
  • sloc: python: 1,845; makefile: 5
file content (11 lines) | stat: -rw-r--r-- 419 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
import pytest

from pyartnet.output_correction import cubic, quadratic, quadruple


@pytest.mark.parametrize('max_val', [
    pytest.param(k, id=f'{k:X}') for k in (0xFF, 0xFFFF, 0xFFFFFF, 0xFFFFFFFF, 0xFFFFFFFFFF)])
@pytest.mark.parametrize('corr', [quadratic, quadruple, cubic])
def test_correction(corr, max_val) -> None:
    assert corr(0, max_val=max_val) == 0
    assert corr(max_val, max_val=max_val) == max_val