Add error checking to the setters for ListControl.displayValue and
CheckboxListControl.displayValue: in line with the old
mechanize-based implementation, these will now raise
ItemNotFoundError if any of the given values are not found, or
ItemCountError on trying to set more than one value on a single-valued
control.
While this could technically be a backward-incompatibility in some
cases, non-matching elements of the requested value were previously
silently ignored, which seems overwhelmingly more likely to have
resulted in hidden bugs.
I considered adding similar checks to the corresponding value setters,
but as far as I can see mechanize didn't have such checks there, so
the compatibility bar for changes is higher. Also, values are more
likely to be stable than labels, and are often shorter identifiers that
are somewhat less prone to typos.
Add error checking to the setters for
ListControl.displayValue
andCheckboxListControl.displayValue
: in line with the oldmechanize
-based implementation, these will now raiseItemNotFoundError
if any of the given values are not found, orItemCountError
on trying to set more than one value on a single-valued control.While this could technically be a backward-incompatibility in some cases, non-matching elements of the requested value were previously silently ignored, which seems overwhelmingly more likely to have resulted in hidden bugs.
I considered adding similar checks to the corresponding
value
setters, but as far as I can seemechanize
didn't have such checks there, so the compatibility bar for changes is higher. Also, values are more likely to be stable than labels, and are often shorter identifiers that are somewhat less prone to typos.Fixes #44.