test_revit_api_catalog
Revit-hosted check that the Revit API change catalog matches the live API.
The static linter dev/scripts/check_revit_api_compat.py trusts
dev/scripts/revit_api_catalog/catalog.json, which is generated offline
from each Revit year's RevitAPI/RevitAPIUI assemblies. Running this suite in
a given Revit confirms that every cataloged type and member exists exactly
when the catalog says it does for that year, catching extraction mistakes and
update-release drift that no offline step can see. Run it from the pyRevit
DevTools "Revit API Catalog Tests" button in each Revit version you have.
The lint itself runs in CI without Revit; this suite only validates its data. It is opt-in: the "Run All Tests" button leaves it out, because it resolves hundreds of types against whichever Revit build is installed.
Note
Years that only some update releases have an entry in (partial) are
not checked, since the result depends on which update is installed.
Skips when the catalog is absent (installed builds ship without dev/)
or when the running Revit year is outside the cataloged years.
Attributes
CATALOG_PATH = os.path.join(HOME_DIR, 'dev', 'scripts', 'revit_api_catalog', 'catalog.json')
module-attribute
MAX_REPORTED = 40
module-attribute
REVIT_NAMESPACES = ('Autodesk.Revit.DB', 'Autodesk.Revit.UI')
module-attribute
Classes
RevitApiCatalogTests
Bases: TestCase
Cataloged availability agrees with the running Revit's API.
Methods:
setUpClass()
classmethod
Load the catalog, or skip when absent or out of range.
Source code in pyrevitlib/pyrevit/unittests/test_revit_api_catalog.py
test_types_exist_when_cataloged()
A cataloged type is importable exactly in its available years.
Source code in pyrevitlib/pyrevit/unittests/test_revit_api_catalog.py
test_members_exist_when_cataloged()
A cataloged member is reachable exactly in its available years.