add two more trivial tests
Some checks failed
Pytest / pytest (3.12) (push) Failing after 26s
Pytest / pytest (3.13) (push) Failing after 30s
Pytest / pytest (3.14) (push) Failing after 30s

This commit is contained in:
Justus Kuhlmann 2025-12-01 18:43:47 +01:00
commit 574877c744
Signed by: jkuhl
GPG key ID: 00ED992DD79B85A6

View file

@ -4,15 +4,21 @@ from corrlib import tools as tl
def test_m2k():
assert tl.m2k(0.1) == 1/(2*0.1+8)
assert tl.m2k(0.5) == 1/(2*0.5+8)
assert tl.m2k(1.0) == 1/(2*1.0+8)
for m in [0.1, 0.5, 1.0]:
expected_k = 1 / (2 * m + 8)
assert tl.m2k(m) == expected_k
def test_k2m():
assert tl.k2m(0.1) == (1/(2*0.1))-4
assert tl.k2m(0.5) == (1/(2*0.5))-4
assert tl.k2m(1.0) == (1/(2*1.0))-4
for m in [0.1, 0.5, 1.0]:
assert tl.k2m(m) == (1/(2*m))-4
def test_k2m_m2k():
for m in [0.1, 0.5, 1.0]:
k = tl.m2k(m)
m_converted = tl.k2m(k)
assert abs(m - m_converted) < 1e-9
def test_str2list():