From ef58dd4582ede4d6192a6a62f5513b2f99090f01 Mon Sep 17 00:00:00 2001 From: Sambhav Dixit <94298612+sambhavnoobcoder@users.noreply.github.com> Date: Sun, 27 Oct 2024 19:04:32 +0530 Subject: [PATCH] Create TestAgentLogging - create class to execute modular unittests - def setup for modular setup - objective to keep setup minimal , so that tests aren't bloated and fast to run - Since most param have a set default , init of necessary condition is a valid and supportive op wrt test speed . --- tests/agents/test_agent_logging.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/agents/test_agent_logging.py b/tests/agents/test_agent_logging.py index e7fd464b..13675858 100644 --- a/tests/agents/test_agent_logging.py +++ b/tests/agents/test_agent_logging.py @@ -5,3 +5,20 @@ from datetime import datetime import unittest from swarms.schemas.agent_step_schemas import ManySteps, Step from swarms.structs.agent import Agent + +class TestAgentLogging(unittest.TestCase): + def setUp(self): + self.mock_tokenizer = MagicMock() + self.mock_tokenizer.count_tokens.return_value = 100 + + self.mock_short_memory = MagicMock() + self.mock_short_memory.get_memory_stats.return_value = {"message_count": 2} + + self.mock_long_memory = MagicMock() + self.mock_long_memory.get_memory_stats.return_value = {"item_count": 5} + + self.agent = Agent( + tokenizer=self.mock_tokenizer, + short_memory=self.mock_short_memory, + long_term_memory=self.mock_long_memory + )