Skip to content

Instantly share code, notes, and snippets.

@parente
Created October 21, 2013 02:10
Show Gist options
  • Select an option

  • Save parente/7077713 to your computer and use it in GitHub Desktop.

Select an option

Save parente/7077713 to your computer and use it in GitHub Desktop.
Accerciser example rule
class CheckFocusable(Validator):
def condition(self, acc):
# only test accessibles that have the action interface
return acc.queryAction()
def after(self, acc, state, view):
# check an accessible after checking its descendants
# acc is the accessible
# state is a dictionary of whatever you need to store across tests
# view logs errors, warnings, etc.
pass
def before(self, acc, state, view):
# check an accessible before checking its descendants
s = acc.getState()
if not s.contains(STATE_FOCUSABLE):
view.error('actionable widget is not focusable')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment