(self)
| 95 | self.tool = FileWriteTool() |
| 96 | |
| 97 | def test_write_new_file(self): |
| 98 | with tempfile.TemporaryDirectory() as tmpdir: |
| 99 | path = Path(tmpdir) / "test.txt" |
| 100 | result = self.tool.execute({"path": str(path), "content": "hello world"}) |
| 101 | self.assertFalse(result.is_error) |
| 102 | self.assertEqual(path.read_text(), "hello world") |
| 103 | |
| 104 | def test_write_creates_directories(self): |
| 105 | with tempfile.TemporaryDirectory() as tmpdir: |