import unittest
from report.report_templates import ReportTemplateManager, QueryType, DetailLevel

class TestReportTemplates(unittest.TestCase):
    def setUp(self):
        self.manager = ReportTemplateManager()
        self.manager.initialize_default_templates()

    def test_template_retrieval(self):
        template = self.manager.get_template(QueryType.FACTUAL, DetailLevel.BRIEF)
        self.assertIsNotNone(template)
        self.assertEqual(template.detail_level, DetailLevel.BRIEF)
        self.assertEqual(template.query_type, QueryType.FACTUAL)

    def test_template_validation(self):
        template = self.manager.get_template(QueryType.FACTUAL, DetailLevel.BRIEF)
        self.assertTrue(template.validate())

    def test_all_templates_available(self):
        templates = self.manager.get_available_templates()
        self.assertEqual(len(templates), 12)  # 3 query types * 4 detail levels

if __name__ == '__main__':
    unittest.main()
