add two more trivial tests
This commit is contained in:
parent
7d8cf4274c
commit
574877c744
1 changed files with 12 additions and 6 deletions
|
|
@ -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():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue