#!/usr/bin/env python3
"""
Test script to verify project configurations
"""

import json
from pathlib import Path


def main():
    projects_file = Path("projects.json")
    if projects_file.exists():
        with open(projects_file, "r", encoding="utf-8") as f:
            data = json.load(f)
        print(f'Proyectos existentes: {len(data.get("projects", []))}')

        if data.get("projects"):
            project = data["projects"][0]
            print(f'Primer proyecto: {project.get("name", "N/A")}')
            print(
                f'Configuraciones en schedule_config: {list(project.get("schedule_config", {}).keys())}'
            )
            print(f'Tiene backup_options: {"backup_options" in project}')

            # Mostrar configuraciones actuales
            schedule_config = project.get("schedule_config", {})
            print(f"Schedule config actual: {schedule_config}")

            backup_options = project.get("backup_options", {})
            print(f"Backup options actual: {backup_options}")
        else:
            print("No hay proyectos en el archivo")
    else:
        print("No hay archivo projects.json")


if __name__ == "__main__":
    main()
