diff --git a/tests/test_video.py b/tests/test_video.py index cc3f005..67640c3 100644 --- a/tests/test_video.py +++ b/tests/test_video.py @@ -28,6 +28,7 @@ BufferType, Capability, ControlClass, + ControlType, Device, InputCapabilities, Memory, @@ -689,7 +690,19 @@ def _(): boolean.value = value assert boolean.value is expected - # String + # menu + menu = controls.menu + assert menu is controls["menu"] + assert menu.type == ControlType.MENU + assert menu[1] == menu.data[1] + + menu.value = 1 + assert menu.value == 1 + + with raises(OSError): + menu.value = 0 + + # string assert controls.string is controls["string"] current_value = controls.string.value try: @@ -709,6 +722,8 @@ def _(): finally: controls.s32_2_element_array.value = current_value + assert controls.s32_2_element_array.default[:] == [2, 2] + assert "" in repr(controls.s32_2_element_array) # matrix 8x16 @@ -727,6 +742,9 @@ def _(): assert area.width == width assert area.height == height + # button + controls.button.push() + # Unknown with raises(KeyError): _ = list(controls.with_class("unknown class"))