import os import json from utils.configmanager import ( load_protected_config, get_protected_value, get_protected_json, PROTECTED_KEYS ) from utils.setup import setup def test_protected_config(): print("๐Ÿ”’ Testing protected config loading...") protected = load_protected_config() assert isinstance(protected, dict), "Protected config should be a dictionary" for key in PROTECTED_KEYS: assert key in protected, f"Missing protected key: {key}" print(f"โœ” {key} = {protected[key]}") def test_json_parsing(): print("\n๐Ÿงช Testing JSON parsing for POLICY_MAP_ENF_AUD...") policy = get_protected_json("POLICY_MAP_ENF_AUD") assert isinstance(policy, dict), "POLICY_MAP_ENF_AUD should be a dictionary" print(f"โœ” POLICY_MAP_ENF_AUD = {json.dumps(policy, indent=2)}") def test_setup_env(): print("\nโš™๏ธ Running setup() to validate environment setup...") working_dir = setup() assert working_dir.exists(), "Working directory should exist" print(f"โœ” Working directory: {working_dir}") print("\n๐ŸŒ Checking .env values (excluding protected)...") for key in os.environ: if key not in PROTECTED_KEYS: print(f"๐Ÿ”ง {key} = {os.environ[key]}") if __name__ == "__main__": test_protected_config() test_json_parsing() test_setup_env()