Coverage for src/lexigram/admin/settings/panel/features_spec.py: 93%

15 statements  

« prev     ^ index     » next       coverage.py v7.15.4, created at 2026-08-24 23:18 +0800

1"""Feature flags configuration specification.""" 

2 

3from __future__ import annotations 

4 

5from lexigram.admin.config import AdminFeaturesConfig 

6from lexigram.admin.settings.panel.nodes import PydanticConfigSpec 

7from lexigram.admin.settings.panel.registry import ConfigRegistry 

8 

9__all__ = ["FeaturesSpec", "register_spec"] 

10 

11 

12class FeaturesSpec(PydanticConfigSpec): 

13 """Configuration spec for high-level admin features.""" 

14 

15 namespace = "admin.features" 

16 label = "Feature Flags" 

17 icon = "toggle-on" 

18 description = "Toggle admin UI and UX features." 

19 model = AdminFeaturesConfig 

20 required_permissions = frozenset({"admin.settings.edit"}) 

21 scope = "tenant" 

22 

23 

24def register_spec(registry: ConfigRegistry) -> None: 

25 """Register this spec with the config registry.""" 

26 registry.register_spec(FeaturesSpec)