feat: first commit

This commit is contained in:
Neeraj Nigam
2026-03-18 21:23:14 -05:00
commit 0b1ec4a818
25 changed files with 3068 additions and 0 deletions

25
tests/test_agent.py Normal file
View File

@@ -0,0 +1,25 @@
"""Unit tests for agent initialization."""
import os
from unittest.mock import patch
import main
class TestAgentInitialization:
@patch.dict(os.environ, {"OPENAI_API_KEY": "test-key"})
def test_agent_has_all_four_tools(self):
"""Agent should be initialized with all four file system tools."""
agent = main.create_agent()
# The agent's tools are accessible via the graph's nodes
# create_agent stores tools in the agent; we can check
# by inspecting the tool names from the agent's tool node.
tool_node = agent.nodes.get("tools")
assert tool_node is not None, "Agent should have a 'tools' node"
# The actual ToolNode is wrapped in a PregelNode; access via .bound
tool_names = list(tool_node.bound.tools_by_name.keys())
expected = {"read_file", "grep", "write_file", "list_dir", "replace_in_file"}
assert set(tool_names) == expected, (
f"Expected tools {expected}, got {set(tool_names)}"
)