diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2017-09-09 21:26:17 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2017-09-09 21:26:17 +0200 |
commit | 542ec502c9b9619c005bc73e562229e4547ab90b (patch) | |
tree | 037e6fdaccdbfb373a91d971ff6fa8de02fe504f /test | |
parent | 6887e773e17beb5a6c2df0c7397d5223eebde37e (diff) | |
download | ee-python-542ec502c9b9619c005bc73e562229e4547ab90b.tar.gz ee-python-542ec502c9b9619c005bc73e562229e4547ab90b.tar.bz2 ee-python-542ec502c9b9619c005bc73e562229e4547ab90b.tar.xz ee-python-542ec502c9b9619c005bc73e562229e4547ab90b.zip |
o Imporing some old parsing code into a EeVal type. Not quite done yet.
Diffstat (limited to 'test')
-rw-r--r-- | test/test_formatting.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/test_formatting.py b/test/test_formatting.py index 18f582c..177912d 100644 --- a/test/test_formatting.py +++ b/test/test_formatting.py @@ -1,6 +1,7 @@ import pytest import numpy as np from ee.formatting import eng_str +from ee import EeVal @pytest.mark.parametrize("input,expected", [ @@ -60,3 +61,16 @@ def xx_test_eng_str2(input, expected): ]) def xx_test_eng_str3(input, expected): assert expected == eng_str(input) + + +@pytest.mark.parametrize("s, expected", [ + ('1', EeVal("1")), + ('10', EeVal("10")), + ('10k', EeVal("10e3")), + ('10 k', EeVal("10e3")), + ('10 k', EeVal("10e3")), + ('1p', EeVal("1e-9")), + ('100n', EeVal("100e-6")), + ]) +def test_EeVal(s, expected): + assert expected == EeVal(s) |