from tests.e2e.runner.runner import E2ERunner
from verse_sdk import observe


class E2ERunnerSync(E2ERunner):
    @observe("e2e.runner.sync", type="trace")
    def _run_agent(self):
        return self._agent.ask("What are Ollie the Owl's friends?")

    def run(self):
        response = self._run_agent()

        self.setup()
        self.assert_messages_in_conversation()
        self.assert_response_len(response)

        for friend in [
            "Sammy the Squirrel",
            "Milo the Monkey",
            "Cleo the Cat",
        ]:
            assert friend in response, f"Response should contain {friend}"

        self.assert_validity()
        self.teardown()
