summaryrefslogtreecommitdiff
path: root/testenv/tests
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2021-01-28 08:12:04 +0300
committerDevaev Maxim <[email protected]>2021-01-28 08:12:04 +0300
commit83184952f6f8d834481cd06aee42474c74bb304c (patch)
treea2b7b0e2edf852d806c274c3557b6ea2b89a1e2a /testenv/tests
parent83f9406fa0c8e5ba2ceb384a2e3c7c6ed5557296 (diff)
h264_bitrate streamer param
Diffstat (limited to 'testenv/tests')
-rw-r--r--testenv/tests/validators/test_kvm.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/testenv/tests/validators/test_kvm.py b/testenv/tests/validators/test_kvm.py
index 4a80b37c..b0058fde 100644
--- a/testenv/tests/validators/test_kvm.py
+++ b/testenv/tests/validators/test_kvm.py
@@ -32,6 +32,7 @@ from kvmd.validators.kvm import valid_log_seek
from kvmd.validators.kvm import valid_stream_quality
from kvmd.validators.kvm import valid_stream_fps
from kvmd.validators.kvm import valid_stream_resolution
+from kvmd.validators.kvm import valid_stream_h264_bitrate
# =====
@@ -126,3 +127,17 @@ def test_ok__valid_stream_resolution(arg: Any) -> None:
def test_fail__valid_stream_resolution(arg: Any) -> None:
with pytest.raises(ValidatorError):
print(valid_stream_resolution(arg))
+
+
+# =====
[email protected]("arg", ["100", " 16000 ", 5000])
+def test_ok__valid_stream_h264_bitrate(arg: Any) -> None:
+ value = valid_stream_h264_bitrate(arg)
+ assert type(value) == int # pylint: disable=unidiomatic-typecheck
+ assert value == int(str(arg).strip())
+
+
[email protected]("arg", ["0", "-1", "100.0", 5000.1, None, ""])
+def test_fail__valid_stream_h264_bitrate(arg: Any) -> None:
+ with pytest.raises(ValidatorError):
+ print(valid_stream_h264_bitrate(arg))