add typing for tests
This commit is contained in:
parent
15bf399a89
commit
14d19ce9dd
5 changed files with 19 additions and 17 deletions
|
|
@ -3,29 +3,29 @@
|
|||
from corrlib import tools as tl
|
||||
|
||||
|
||||
def test_m2k():
|
||||
def test_m2k() -> None:
|
||||
for m in [0.1, 0.5, 1.0]:
|
||||
expected_k = 1 / (2 * m + 8)
|
||||
assert tl.m2k(m) == expected_k
|
||||
|
||||
|
||||
def test_k2m():
|
||||
def test_k2m() -> None:
|
||||
for m in [0.1, 0.5, 1.0]:
|
||||
assert tl.k2m(m) == (1/(2*m))-4
|
||||
|
||||
|
||||
def test_k2m_m2k():
|
||||
def test_k2m_m2k() -> None:
|
||||
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():
|
||||
def test_str2list() -> None:
|
||||
assert tl.str2list("a,b,c") == ["a", "b", "c"]
|
||||
assert tl.str2list("1,2,3") == ["1", "2", "3"]
|
||||
|
||||
|
||||
def test_list2str():
|
||||
def test_list2str() -> None:
|
||||
assert tl.list2str(["a", "b", "c"]) == "a,b,c"
|
||||
assert tl.list2str(["1", "2", "3"]) == "1,2,3"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue