Test error handling.
(self)
| 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.""" |
no test coverage detected