summaryrefslogtreecommitdiff
path: root/testenv
diff options
context:
space:
mode:
Diffstat (limited to 'testenv')
-rw-r--r--testenv/main.yaml2
-rw-r--r--testenv/tests/validators/test_basic.py15
2 files changed, 17 insertions, 0 deletions
diff --git a/testenv/main.yaml b/testenv/main.yaml
index f0f48d4d..e1589a34 100644
--- a/testenv/main.yaml
+++ b/testenv/main.yaml
@@ -25,6 +25,8 @@ kvmd:
streamer:
cap_pin: 17
conv_pin: 18
+ sync_delay: 0
+ init_delay: 1
init_restart_after: 1
desired_fps: 30
max_fps: 40
diff --git a/testenv/tests/validators/test_basic.py b/testenv/tests/validators/test_basic.py
index 96feb666..15964a54 100644
--- a/testenv/tests/validators/test_basic.py
+++ b/testenv/tests/validators/test_basic.py
@@ -29,6 +29,7 @@ from kvmd.validators import ValidatorError
from kvmd.validators.basic import valid_bool
from kvmd.validators.basic import valid_number
from kvmd.validators.basic import valid_int_f1
+from kvmd.validators.basic import valid_float_f0
from kvmd.validators.basic import valid_float_f01
from kvmd.validators.basic import valid_string_list
@@ -96,6 +97,20 @@ def test_fail__valid_int_f1(arg: Any) -> None:
# =====
[email protected]("arg", [0, 1, 5, "5 ", "5.0 "])
+def test_ok__valid_float_f0(arg: Any) -> None:
+ value = valid_float_f0(arg)
+ assert type(value) == float # pylint: disable=unidiomatic-typecheck
+ assert value == float(str(arg).strip())
+
+
[email protected]("arg", ["test", "", None, -6, "-6"])
+def test_fail__valid_float_f0(arg: Any) -> None:
+ with pytest.raises(ValidatorError):
+ print(valid_float_f0(arg))
+
+
+# =====
@pytest.mark.parametrize("arg", [0.1, 1, 5, "5 ", "5.0 "])
def test_ok__valid_float_f01(arg: Any) -> None:
value = valid_float_f01(arg)