agent-app / tests /test_agent.py
ganeshkota's picture
Initial scaffold for agent app
2d1010b
Raw
History Blame Contribute Delete
564 Bytes
import sys
import unittest
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
SRC = ROOT / "src"
if str(SRC) not in sys.path:
sys.path.insert(0, str(SRC))
from agent_app.agent import SimpleAgent
class SimpleAgentTests(unittest.TestCase):
def test_agent_returns_message(self) -> None:
agent = SimpleAgent(name="Tester")
response = agent.respond("hello")
self.assertEqual(response.text, "Tester received: hello")
self.assertEqual(len(response.history), 2)
if __name__ == "__main__":
unittest.main()