Commit 5ed5e675 authored by David Trudgian's avatar David Trudgian
Browse files

Support real 1e3 type inputs

parent e850d1ce
...@@ -154,16 +154,16 @@ ...@@ -154,16 +154,16 @@
"type":"boolean" "type":"boolean"
}, },
"min":{ "min":{
"type":"number" "type":["number", "string"]
}, },
"max":{ "max":{
"type":"number" "type":["number", "string"]
}, },
"step":{ "step":{
"type":"number" "type":["number", "string"]
}, },
"scale":{ "scale":{
"type":"number" "type":["number", "string"]
}, },
"description":{ "description":{
"type":"string" "type":"string"
......
...@@ -77,6 +77,11 @@ class TestParams: ...@@ -77,6 +77,11 @@ class TestParams:
'step': 0.2}) 'step': 0.2})
assert rr.to_list() == pytest.approx([0.001, 0.21, 2.3, 23.2, 232.2]) assert rr.to_list() == pytest.approx([0.001, 0.21, 2.3, 23.2, 232.2])
def test_real_range_exponent(self):
rr = RealRange({'id': 'test', 'min': 1e-6, 'max': 1e3, 'scale': 1e1,
'step': 0.2})
assert rr.to_list() == pytest.approx([1e-6, 0.20001, 2.2001, 22.201, 222.21])
def test_real_range_optional(self): def test_real_range_optional(self):
rr = RealRange({'id': 'test', 'min': 0.001, 'max': 10.0, 'scale': 10, rr = RealRange({'id': 'test', 'min': 0.001, 'max': 10.0, 'scale': 10,
'optional': True}) 'optional': True})
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment