import unittest

from ai_landscape_review.prompts import (
    build_gap_analysis_prompt,
    build_research_prompt,
    build_synthesis_prompt,
)


class PromptTemplateTests(unittest.TestCase):
    def test_gap_prompt_mentions_websearch_and_no_gaps(self) -> None:
        prompt = build_gap_analysis_prompt("weekly", "raw feed")
        self.assertIn("WebSearch", prompt)
        self.assertIn("NO GAPS", prompt)
        self.assertIn("past 7 days", prompt)

    def test_research_prompt_requires_primary_sources(self) -> None:
        prompt = build_research_prompt("- investigate model release")
        self.assertIn("primary sources", prompt)
        self.assertIn("Banking and financial services implication", prompt)

    def test_weekly_synthesis_prompt_has_required_sections(self) -> None:
        prompt = build_synthesis_prompt("weekly", "raw", "previous", "research")
        self.assertIn("**Top developments:**", prompt)
        self.assertIn("**Also notable:**", prompt)
        self.assertIn("**Pattern watch:**", prompt)
        self.assertIn("Do not repeat items already covered", prompt)

    def test_monthly_synthesis_prompt_exposes_title_and_sections(self) -> None:
        prompt = build_synthesis_prompt("monthly", "raw", "previous", "research")
        self.assertIn("**Title:**", prompt)
        self.assertIn("#### Themes", prompt)
        self.assertIn("#### Radar", prompt)
        self.assertIn("#### What Clients Should Be Asking But Aren't", prompt)


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