MCPcopy Create free account
hub / github.com/SkyworkAI/DeepResearchAgent / test_error_handling

Method test_error_handling

tests/test_file_system.py:220–241  ·  view source on GitHub ↗

Test error handling.

(self)

Source from the content-addressed store, hash-verified

218 self.assert_test('.txt' in extensions and '.json' in extensions, result)
219
220 async def test_error_handling(self):
221 """Test error handling."""
222 print("\n=== Testing Error Handling ===")
223
224 # Test file not found
225 result = await self.fs.read_file(str(self.test_dir / "nonexistent.txt"))
226 self.assert_test("Error:" in result, result)
227
228 # Test invalid path
229 try:
230 result = await self.fs.read_file("/invalid/absolute/path")
231 self.assert_test("Error:" in result, result)
232 except Exception:
233 self.assert_test(True, "Handle invalid path (exception)")
234
235 # Test directory not found for tree
236 result = await self.fs.tree_structure(str(self.test_dir / "nonexistent"))
237 self.assert_test("Error:" in result, result)
238
239 # Test invalid search type
240 result = await self.fs.search_files(str(self.test_dir), "test", search_type="invalid")
241 self.assert_test("Error:" in result, result)
242
243 async def test_edge_cases(self):
244 """Test edge cases."""

Callers 1

run_all_testsMethod · 0.95

Calls 2

assert_testMethod · 0.95
printFunction · 0.85

Tested by

no test coverage detected