"""Integration tests for CerbosPolicyParser against demo policy files.""" from pdp.connectors.cerbos_policy_parser import CerbosPolicyParser def test_build_database_from_demo_policies_directory() -> None: """Parser should load metadata from cerbos/policies/demo end-to-end.""" parser = CerbosPolicyParser(policies_dir="cerbos/policies/demo") database = parser.build_database() assert database.get_policy("demo_action_wildcard") is not None assert not database.requires_account_feature_controls("demo_action_wildcard") assert database.get_policy("demo_check_feature_control") is not None assert database.requires_account_feature_controls("demo_check_feature_control") assert database.get_policy("demo_impersonation") is not None assert not database.requires_account_feature_controls("demo_impersonation")