def test_set_option_value(self): for opt_idx in range(0, self.nb_options): desc = rawapi.sane_get_option_descriptor(self.dev_handle, opt_idx) if desc.name != "mode" or not rawapi.SaneValueType(desc.type).can_getset_opt(): continue info = rawapi.sane_set_option_value(self.dev_handle, opt_idx, "Gray") self.assertFalse(rawapi.SaneInfo.INEXACT in info) val = rawapi.sane_get_option_value(self.dev_handle, opt_idx) self.assertEqual(val, "Gray")
def test_set_option_value(self): for opt_idx in range(0, self.nb_options): desc = rawapi.sane_get_option_descriptor(self.dev_handle, opt_idx) if (desc.name != "mode" or not rawapi.SaneValueType(desc.type).can_getset_opt()): continue info = rawapi.sane_set_option_value(self.dev_handle, opt_idx, "Gray") self.assertFalse(rawapi.SaneInfo.INEXACT in info) val = rawapi.sane_get_option_value(self.dev_handle, opt_idx) self.assertEqual(val, "Gray")
def _set_value(self, new_value): self.__scanner._open() rawapi.sane_set_option_value(sane_dev_handle[1], self.idx, new_value)