test_ribbon_control_ids
Hosted tests for the ribbon ids the loader registers for pyRevit's own panels.
Run from Revit via the DevTools "Ribbon Control Id Tests" button (zero-doc
context). The module is Integration level, so "Run All Tests" skips it. They
assert that the control id of every command in the pyRevit tab resolves to the
ribbon item Revit registered, whatever the pyRevit user_locale: panels are
created under their folder name and only display the localized title (#4035).
Attributes
TEST_ENVIRONMENT = 'Revit'
module-attribute
TEST_LEVEL = 'Integration'
module-attribute
PYREVIT_TAB_PREFIX = 'CustomCtrl_%CustomCtrl_%pyRevit%'
module-attribute
Classes
ControlIdTests
Bases: TestCase
Command control ids equal the ids of the ribbon items Revit registered.
Methods:
test_pyrevit_tab_commands_are_loaded()
The pyRevit tab contributes commands, so the checks below are not vacuous.
test_control_id_matches_a_ribbon_item()
Every pyRevit tab command's control id is the id of a ribbon item.
Source code in pyrevitlib/pyrevit/unittests/test_ribbon_control_ids.py
test_control_id_resolves_to_a_command_id()
Every pyRevit tab command's control id resolves through LookupCommandId.