aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2019-05-27 13:52:20 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2019-05-27 13:52:20 +0200
commit94e8537430ab7496e4b8e697581d65b06cf8b979 (patch)
tree400ddf6deac24ce3b21a0678bfe9afb5f7f8a1e9 /test
parent0259c6f907875b54e5d1df4bc89efa1c293d2812 (diff)
downloadee-python-94e8537430ab7496e4b8e697581d65b06cf8b979.tar.gz
ee-python-94e8537430ab7496e4b8e697581d65b06cf8b979.tar.bz2
ee-python-94e8537430ab7496e4b8e697581d65b06cf8b979.tar.xz
ee-python-94e8537430ab7496e4b8e697581d65b06cf8b979.zip
EeVal: Supporting omega symbol in addition to ohm symbol (which are
usually graphically equal).
Diffstat (limited to 'test')
-rw-r--r--test/test_EeVal.py51
1 files changed, 27 insertions, 24 deletions
diff --git a/test/test_EeVal.py b/test/test_EeVal.py
index 6d4032f..f311aa6 100644
--- a/test/test_EeVal.py
+++ b/test/test_EeVal.py
@@ -3,31 +3,31 @@ from ee import EeVal
@pytest.mark.parametrize("s, num_value, str_value, unit", [
- # ("0", 0, "0", None),
- # ("0 k", 0, "0", None),
- # ("1", 1, "1", None),
- # ("1e-3", 0.001, "1 m", None),
- # ("1e3", 1000, "1 k", None),
- # ("4.7e3", 4700, "4.7 k", None),
+ ("0", 0, "0", None),
+ ("0 k", 0, "0", None),
+ ("1", 1, "1", None),
+ ("1e-3", 0.001, "1 m", None),
+ ("1e3", 1000, "1 k", None),
+ ("4.7e3", 4700, "4.7 k", None),
("4.e3", 4000, "4 k", None),
- # ("10", 10, "10", None),
- # ("10k", 10 * 1000, "10 k", None),
- # ("10 k", 10 * 1000, "10 k", None),
- # ("10 k", 10 * 1000, "10 k", None),
- # ("1000 m", 1, "1", None),
- # ("100 m", 0.1, "100 m", None),
- # ("100 n", 0.0000001, "100 n", None),
- # ("1 m", 0.001, "1 m", None),
- # ("1 u", 0.000001, "1 u", None),
- # ("0.1 u", 0.0000001, "100 n", None),
- # (".1 u", 0.0000001, "100 n", None),
- # ("4.7 u", 0.0000047, "4.7 u", None),
- # ("1 µ", 0.000001, "1 u", None),
- # ("1 n", 0.000000001, "1 n", None),
- # ("10 n", 0.00000001, "10 n", None),
- # ("1p", 1e-12, "1 p", None),
- # ("0.8p", 8e-13, "0.8 p", None),
- # ("0.008p", 8e-15, "0.008 p", None),
+ ("10", 10, "10", None),
+ ("10k", 10 * 1000, "10 k", None),
+ ("10 k", 10 * 1000, "10 k", None),
+ ("10 k", 10 * 1000, "10 k", None),
+ ("1000 m", 1, "1", None),
+ ("100 m", 0.1, "100 m", None),
+ ("100 n", 0.0000001, "100 n", None),
+ ("1 m", 0.001, "1 m", None),
+ ("1 u", 0.000001, "1 u", None),
+ ("0.1 u", 0.0000001, "100 n", None),
+ (".1 u", 0.0000001, "100 n", None),
+ ("4.7 u", 0.0000047, "4.7 u", None),
+ ("1 µ", 0.000001, "1 u", None),
+ ("1 n", 0.000000001, "1 n", None),
+ ("10 n", 0.00000001, "10 n", None),
+ ("1p", 1e-12, "1 p", None),
+ ("0.8p", 8e-13, "0.8 p", None),
+ ("0.008p", 8e-15, "0.008 p", None),
])
def test_basic(s, num_value, str_value, unit):
num_value = float(num_value)
@@ -45,6 +45,9 @@ def test_basic(s, num_value, str_value, unit):
("10n F", "10 nF", "F"),
("10 n F", "10 nF", "F"),
("4.7 n F", "4.7 nF", "F"),
+ ("10Ω", "10 Ω", "Ω"),
+ ("10 Ω", "10 Ω", "Ω"),
+ ("10 Ohm", "10 Ohm", "Ohm"),
])
def test_units(s, str_value, unit):
v = EeVal(s)