-
Notifications
You must be signed in to change notification settings - Fork 514
Expand file tree
/
Copy pathtest_agent.py
More file actions
34 lines (29 loc) · 1.12 KB
/
test_agent.py
File metadata and controls
34 lines (29 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import unittest
from app.agents.sunbird_agent import build_agent
from config.settings import SUNBIRD_BASE_URL, SUNBIRD_AUTH_TOKEN, DEFAULT_USER_ID
class TestSunbirdAgent(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.context = {
"base_url": SUNBIRD_BASE_URL,
"token": SUNBIRD_AUTH_TOKEN,
"user_id": DEFAULT_USER_ID
}
cls.agent = build_agent(cls.context)
def test_course_metadata_tool(self):
prompt = "List some available courses"
response = self.agent.chat(prompt)
self.assertIn("result", response)
print("Course Metadata Tool Output:", response)
def test_enrollment_tool(self):
prompt = "Show my enrolled courses"
response = self.agent.chat(prompt)
self.assertIn("result", response)
print("Enrollment Tool Output:", response)
def test_profile_tool(self):
prompt = "What is my profile info?"
response = self.agent.chat(prompt)
self.assertIn("result", response)
print("User Profile Tool Output:", response)
if __name__ == "__main__":
unittest.main()