test/first (#8)
Introducing first very simple tests for tools.py Reviewed-on: https://www.kuhl-mann.de/git/git/jkuhl/corrlib/pulls/8
This commit is contained in:
parent
acab85df82
commit
d70e8d32ce
9 changed files with 1650 additions and 11 deletions
|
|
@ -14,4 +14,4 @@ def test_toml_check_measurement_data():
|
|||
"names": ['list', 'of', 'names']
|
||||
}
|
||||
}
|
||||
t.check_measurement_data(measurements)
|
||||
t.check_measurement_data(measurements, "sfcf")
|
||||
|
|
|
|||
25
tests/tools_test.py
Normal file
25
tests/tools_test.py
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
|
||||
|
||||
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)
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
||||
def test_str2list():
|
||||
assert tl.str2list("a,b,c") == ["a", "b", "c"]
|
||||
assert tl.str2list("1,2,3") == ["1", "2", "3"]
|
||||
|
||||
|
||||
def test_list2str():
|
||||
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