def camera_nomock(usb, gtp, lua, config): gtp.return_value = 'odd' usbdev = mock.Mock() usbdev.bus, usbdev.address = 1, 2 lua.return_value = {'build_revision': 3000} usb.util.get_string.return_value = b'12345678\x00\x00\x00' return chdkcamera.CHDKCameraDevice(config, usbdev)
def test_init_noremote(usb, lua, config): usbdev = mock.Mock() usbdev.bus, usbdev.address = 1, 2 lua.return_value = {'build_revision': 2500} usb.util.get_string.return_value = b'12345678\x00\x00\x00' dev = chdkcamera.CHDKCameraDevice(config, usbdev) assert dev._can_remote is False
def test_init_noremote(chdkdev): chdkdev.lua_execute.side_effect = [{'build_revision': 2926}, 8, None] dev = chdkcamera.CHDKCameraDevice(config, chdkdev) assert dev._can_remote is False
def camera(chdkdev, config): return chdkcamera.CHDKCameraDevice(config, chdkdev)