diff options
Diffstat (limited to 'test/test_formatting.py')
-rw-r--r-- | test/test_formatting.py | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/test/test_formatting.py b/test/test_formatting.py index 6fa0b07..18f582c 100644 --- a/test/test_formatting.py +++ b/test/test_formatting.py @@ -2,6 +2,7 @@ import pytest import numpy as np from ee.formatting import eng_str + @pytest.mark.parametrize("input,expected", [ (0, "0"), (5.5, "5.5"), @@ -18,29 +19,32 @@ from ee.formatting import eng_str (0.000055, "55 u"), (0.0000055, "5.5 u"), (0.00000055, "550 p"), - ]) +]) def test_eng_str(input, expected): - assert expected == eng_str(input) - npinput = np.float64(input) - assert expected == eng_str(npinput) + assert expected == eng_str(input) + npinput = np.float64(input) + assert expected == eng_str(npinput) + @pytest.mark.parametrize("input,expected", [ (0, "0 A"), (5.5, "5.5 A"), (1100, "1.1 kA"), (0.05, "50 mA"), - ]) +]) def test_eng_str_with_unit(input, expected): - assert expected == eng_str(input, unit = 'A') + assert expected == eng_str(input, unit='A') + @pytest.mark.parametrize("input,expected", [ (100, ''), (101, ''), (102, ''), (103, ''), (104, ''), (105, ''), (106, ''), (107, ''), (108, ''), (109, ''), (110, ''), (111, ''), (112, ''), (113, ''), (114, ''), (115, ''), (116, ''), (117, ''), (118, ''), (119, ''), (120, ''), (121, ''), (122, ''), (123, ''), (124, ''), (125, ''), (126, ''), (127, ''), (128, ''), (129, ''), (130, ''), (131, ''), (132, ''), (133, ''), (134, ''), (135, ''), (136, ''), (137, ''), (138, ''), (139, ''), - ]) +]) def xx_test_eng_str2(input, expected): - assert expected == eng_str(input) + assert expected == eng_str(input) + @pytest.mark.parametrize("input,expected", [ (10, '10'), @@ -53,6 +57,6 @@ def xx_test_eng_str2(input, expected): (17, '17'), (18, '18'), (19, '19'), - ]) +]) def xx_test_eng_str3(input, expected): - assert expected == eng_str(input) + assert expected == eng_str(input) |