From 63aa4a07a72276eb065196ce1900a046f76ff3e0 Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Sat, 6 Feb 2021 19:27:00 +0300 Subject: refactored streamer params, added h264 gop --- testenv/tests/validators/test_kvm.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'testenv') diff --git a/testenv/tests/validators/test_kvm.py b/testenv/tests/validators/test_kvm.py index b0058fde..c6ba4436 100644 --- a/testenv/tests/validators/test_kvm.py +++ b/testenv/tests/validators/test_kvm.py @@ -33,6 +33,7 @@ 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 +from kvmd.validators.kvm import valid_stream_h264_gop # ===== @@ -141,3 +142,17 @@ def test_ok__valid_stream_h264_bitrate(arg: Any) -> None: def test_fail__valid_stream_h264_bitrate(arg: Any) -> None: with pytest.raises(ValidatorError): print(valid_stream_h264_bitrate(arg)) + + +# ===== +@pytest.mark.parametrize("arg", ["1 ", 0, 60]) +def test_ok__valid_stream_h264_gop(arg: Any) -> None: + value = valid_stream_h264_gop(arg) + assert type(value) == int # pylint: disable=unidiomatic-typecheck + assert value == int(str(arg).strip()) + + +@pytest.mark.parametrize("arg", ["test", "", None, 61, 1.1]) +def test_fail__valid_stream_h264_gop(arg: Any) -> None: + with pytest.raises(ValidatorError): + print(valid_stream_h264_gop(arg)) -- cgit v1.2.3