MCPcopy
hub / github.com/langroid/langroid / test_read_file_tool_not_exist

Function test_read_file_tool_not_exist

tests/main/test_file_tools.py:179–187  ·  view source on GitHub ↗
(test_settings: Settings, temp_dir, agent)

Source from the content-addressed store, hash-verified

177
178
179def test_read_file_tool_not_exist(test_settings: Settings, temp_dir, agent):
180 set_global(test_settings)
181
182 custom_read_file_tool = ReadFileTool.create(get_curr_dir=lambda: temp_dir)
183 agent.enable_message(custom_read_file_tool)
184 task = lr.Task(agent, interactive=False, done_if_response=[lr.Entity.AGENT])
185 nonexistent_file = "nonexistent.txt"
186 agent_result = task.run(f"Read the contents of the file '{nonexistent_file}'")
187 assert "File not found" in agent_result.content
188
189
190def test_read_file_tool_multiple_files(test_settings: Settings, temp_dir, agent):

Callers

nothing calls this directly

Calls 4

runMethod · 0.95
set_globalFunction · 0.90
createMethod · 0.45
enable_messageMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…