From 542ec502c9b9619c005bc73e562229e4547ab90b Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sat, 9 Sep 2017 21:26:17 +0200 Subject: o Imporing some old parsing code into a EeVal type. Not quite done yet. --- test/test_formatting.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test') 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) -- cgit v1.2.3