mxivideo/test_template_loading.py

31 lines
759 B
Python

#!/usr/bin/env python3
"""
Test script to verify template loading functionality
"""
import sys
import json
from python_core.services.template_manager import TemplateManager
from python_core.utils.jsonrpc import create_response_handler
def test_get_templates():
"""Test getting templates"""
rpc = create_response_handler("test")
try:
manager = TemplateManager()
templates = manager.get_templates()
result = {
"status": True,
"templates": [template.__dict__ for template in templates]
}
rpc.success(result)
except Exception as e:
rpc.error(-32603, f"Failed to get templates: {str(e)}")
if __name__ == "__main__":
test_get_templates()