Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tianjing-li committed Nov 4, 2024
1 parent bd6c06d commit 36264f6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 12 deletions.
15 changes: 4 additions & 11 deletions src/backend/tests/unit/config/test_deployments.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
from unittest.mock import Mock
from backend.config.tools import Tool

from backend.config.deployments import (
get_default_deployment,
)
from backend.tests.unit.model_deployments.mock_deployments.mock_cohere_platform import (
MockCohereDeployment,
)


def test_get_default_deployment(mock_available_model_deployments: Mock) -> None:
default_deployment = get_default_deployment()
assert isinstance(default_deployment, MockCohereDeployment)
def test_all_tools_have_id() -> None:
for tool in Tool:
assert tool.value.ID is not None
Empty file.
2 changes: 2 additions & 0 deletions src/backend/tests/unit/crud/test_agent_tool_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,12 @@ def test_get_all_agent_tool_metadata_by_agent_id(session, user):
artifacts=[mock_artifact_1, mock_artifact_2],
)


# Constraint was added preventing multiple entries for the same user + agent + tool so fixing to change the tool used
i = 0
for tool in Tool:
i += 1

_ = get_factory("Agent", session).create(user_id=user.id)
_ = get_factory("AgentToolMetadata", session).create(
id=f"{i}",
Expand Down
2 changes: 1 addition & 1 deletion src/backend/tools/slack/tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class SlackTool(BaseTool):
Tool that searches Slack for messages and files based on a query.
"""

NAME = SLACK_TOOL_ID
ID = SLACK_TOOL_ID
CLIENT_ID = ""
CLIENT_SECRET = ""

Expand Down

0 comments on commit 36264f6

Please sign in to comment.