Fix import of nomie numerical score values
This commit is contained in:
parent
aa2aff4e17
commit
b9c89155e3
3 changed files with 38 additions and 15 deletions
18
tests/test_nomiedata.py
Normal file
18
tests/test_nomiedata.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
from habitmove import nomiedata
|
||||
|
||||
|
||||
def test_score_numerical_becomes_int():
|
||||
sut = nomiedata.Tracker(label="Int checking", tag="isint", id="1337", score="-1")
|
||||
assert type(sut.score) == int
|
||||
|
||||
|
||||
def test_score_invalid_int_stays_string():
|
||||
sut = nomiedata.Tracker(label="Int checking", tag="isint", id="1337", score="-1.3")
|
||||
assert type(sut.score) == str
|
||||
|
||||
|
||||
def test_score_string_stays_string():
|
||||
sut = nomiedata.Tracker(
|
||||
label="Int checking", tag="isint", id="1337", score="custom"
|
||||
)
|
||||
assert type(sut.score) == str
|
||||
Loading…
Add table
Add a link
Reference in a new issue