Integration test

- apart of modular and small unittests , its time to put to test for larger and more wholesome integration test
- an end to end test , to check if this change in code causes any breaks in flow and normal functioning .
pull/615/head
Sambhav Dixit 2 months ago committed by GitHub
parent d72d2e74ff
commit 67a8493340
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -58,3 +58,29 @@ class TestAgentLogging(unittest.TestCase):
200 200
) )
self.assertEqual(len(self.agent.agent_output.steps), 1) self.assertEqual(len(self.agent.agent_output.steps), 1)
class TestAgentLoggingIntegration(unittest.TestCase):
def setUp(self):
self.agent = Agent(agent_name="test-agent")
def test_full_logging_cycle(self):
task = "Test task"
max_loops = 1
result = self.agent._run(task, max_loops=max_loops)
self.assertIsInstance(result, dict)
self.assertIn('steps', result)
self.assertIsInstance(result['steps'], list)
self.assertEqual(len(result['steps']), max_loops)
if result['steps']:
step = result['steps'][0]
self.assertIn('step_id', step)
self.assertIn('timestamp', step)
self.assertIn('task', step)
self.assertIn('response', step)
self.assertEqual(step['task'], task)
self.assertEqual(step['response'], f"Response for loop 1")
self.assertTrue(len(self.agent.agent_output.steps) > 0)

Loading…
Cancel
Save