shinkan-jinkendo/backend/tests/test_rights_registry.py
Lars 4130a63dfe
All checks were successful
Deploy Development / deploy (push) Successful in 44s
Test Suite / pytest-backend (push) Successful in 42s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 13s
Test Suite / k6 /health Baseline (push) Successful in 35s
Test Suite / playwright-tests (push) Successful in 1m51s
Implement Registry-First Approach for Rights and Capabilities Management
- Updated the capability catalog to reflect a registry-first approach, requiring modules to register rights and quotas upon implementation.
- Enhanced the backend to synchronize the rights registry with the database, ensuring only registered capabilities and features are displayed in the admin matrix.
- Modified SQL queries in the admin rights router to filter capabilities and features based on module registration.
- Updated documentation to clarify the new rights and features registry process, replacing the previous catalog-first method.
- Incremented application version to 0.8.201 and updated database schema version to 20260606084 to reflect these changes.
2026-06-07 15:36:31 +02:00

34 lines
949 B
Python

"""Registry-first: Modul-Registrierungen."""
import rights_registrations # noqa: F401
from rights_registry import (
CapabilityRegistration,
registered_capabilities,
registered_features,
register_capability,
)
def test_exercises_module_registers_wired_capabilities():
assert "exercises.ai.suggest" in registered_capabilities()
assert registered_capabilities()["exercises.ai.suggest"].module == "exercises"
def test_register_capability_requires_module():
try:
register_capability(
CapabilityRegistration(
id="test.no.module",
name="Test",
domain="test",
module="",
)
)
assert False, "expected ValueError"
except ValueError:
pass
def test_registered_features_include_ai_calls():
assert "ai_calls" in registered_features()
assert registered_features()["ai_calls"].module == "exercises"