import unittest


class TestAgentRunResult(unittest.TestCase):
    def test_initialize(self):
        from pydantic import ValidationError

        from screensuite.benchmarks.multistep.config import AgentRunResult

        run_result = AgentRunResult(
            model_id="test-model",
            question="What is the capital of France?",
            original_question="What is the capital of France?",
            answer=["Paris"],
            reference_answer=[
                {"match_function_name": "url_included_match", "content": {"url": "https://www.google.com"}}
            ],
            intermediate_steps=[],
            start_time=0.0,
            end_time=1.0,
            token_counts={"total": 100},
        )
        assert run_result.answer == ["Paris"]

        with self.assertRaises(ValidationError):
            run_result = AgentRunResult(
                model_id="test-model",
                question="What is the capital of France?",
                original_question=[],
                reference_answer=[
                    {"match_function_name": "url_included_match", "content": {"url": "https://www.google.com"}}
                ],
                intermediate_steps=[],
                start_time=0.0,
                end_time=1.0,
                token_counts={"total": 100},
            )
