Skip to content

Commit

Permalink
more working unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
luciferlinx101 committed Jul 4, 2023
1 parent 201ef50 commit 5412f63
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions tests/unit_tests/models/test_agent_execution_config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import unittest
from unittest.mock import MagicMock, patch

from superagi.models.agent_execution_config import AgentExecutionConfiguration


Expand All @@ -22,11 +23,9 @@ def test_add_or_update_agent_execution_config(self):
AgentExecutionConfiguration.add_or_update_agent_execution_config(self.session, self.execution,
test_config)

# additional assertions to validate behaviour can be added here

def test_fetch_configuration(self):
test_db_response = [MagicMock(key="goal", value="test_goal"),
MagicMock(key="instruction", value="test_instruction")]
test_db_response = [MagicMock(key="goal", value="['test_goal']"),
MagicMock(key="instruction", value="['test_instruction']")]

self.session.query.return_value.filter_by.return_value.all.return_value = test_db_response

Expand All @@ -35,7 +34,6 @@ def test_fetch_configuration(self):
expected_result = {"goal": ["test_goal"], "instruction": ["test_instruction"]}
self.assertDictEqual(result, expected_result)


def test_eval_agent_config(self):
key = "goal"
value = "['test_goal']"
Expand Down

0 comments on commit 5412f63

Please sign in to comment.