[Checkins] [zopefoundation/zope.testbrowser] 51bc1f: Add error checking to displayValue setters

Colin Watson noreply at github.com
Tue Nov 12 09:38:20 CET 2019


  Branch: refs/heads/master
  Home:   https://github.com/zopefoundation/zope.testbrowser
  Commit: 51bc1fec367bd4b7eb32a67799b79cfc71bb020d
      https://github.com/zopefoundation/zope.testbrowser/commit/51bc1fec367bd4b7eb32a67799b79cfc71bb020d
  Author: Colin Watson <cjwatson at debian.org>
  Date:   2019-11-11 (Mon, 11 Nov 2019)

  Changed paths:
    M CHANGES.rst
    M docs/narrative.rst
    M src/zope/testbrowser/browser.py
    M src/zope/testbrowser/tests/test_browser.py

  Log Message:
  -----------
  Add error checking to displayValue setters

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.

Fixes #44.


  Commit: 7d12a97097a726e3fab594245738847a568a7780
      https://github.com/zopefoundation/zope.testbrowser/commit/7d12a97097a726e3fab594245738847a568a7780
  Author: Colin Watson <cjwatson at ubuntu.com>
  Date:   2019-11-12 (Tue, 12 Nov 2019)

  Changed paths:
    M CHANGES.rst
    M docs/narrative.rst
    M src/zope/testbrowser/browser.py
    M src/zope/testbrowser/tests/test_browser.py

  Log Message:
  -----------
  Merge pull request #89 from cjwatson/strict-displayValue-setter

Add error checking to displayValue setters


Compare: https://github.com/zopefoundation/zope.testbrowser/compare/8a5c01f3185b...7d12a97097a7


More information about the checkins mailing list