mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-05-06 09:42:39 +00:00
Adding Snowflake search tool
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import os
|
||||
import pytest
|
||||
|
||||
from crewai_tools import FileReadTool
|
||||
|
||||
|
||||
def test_file_read_tool_constructor():
|
||||
"""Test FileReadTool initialization with file_path."""
|
||||
# Create a temporary test file
|
||||
@@ -18,6 +19,7 @@ def test_file_read_tool_constructor():
|
||||
# Clean up
|
||||
os.remove(test_file)
|
||||
|
||||
|
||||
def test_file_read_tool_run():
|
||||
"""Test FileReadTool _run method with file_path at runtime."""
|
||||
# Create a temporary test file
|
||||
@@ -34,6 +36,7 @@ def test_file_read_tool_run():
|
||||
# Clean up
|
||||
os.remove(test_file)
|
||||
|
||||
|
||||
def test_file_read_tool_error_handling():
|
||||
"""Test FileReadTool error handling."""
|
||||
# Test missing file path
|
||||
@@ -58,6 +61,7 @@ def test_file_read_tool_error_handling():
|
||||
os.chmod(test_file, 0o666) # Restore permissions to delete
|
||||
os.remove(test_file)
|
||||
|
||||
|
||||
def test_file_read_tool_constructor_and_run():
|
||||
"""Test FileReadTool using both constructor and runtime file paths."""
|
||||
# Create two test files
|
||||
|
||||
Reference in New Issue
Block a user