(self)
| 294 | self.assertEqual(len(coder.abs_fnames), initial_count - 1) |
| 295 | |
| 296 | def test_cmd_drop_without_glob(self): |
| 297 | # Initialize the Commands and InputOutput objects |
| 298 | io = InputOutput(pretty=False, fancy_input=False, yes=True) |
| 299 | from aider.coders import Coder |
| 300 | |
| 301 | coder = Coder.create(self.GPT35, None, io) |
| 302 | commands = Commands(io, coder) |
| 303 | |
| 304 | # Create test files |
| 305 | test_files = ["file1.txt", "file2.txt", "file3.py"] |
| 306 | for fname in test_files: |
| 307 | Path(fname).touch() |
| 308 | |
| 309 | # Add all files to the chat session |
| 310 | for fname in test_files: |
| 311 | commands.cmd_add(fname) |
| 312 | |
| 313 | initial_count = len(coder.abs_fnames) |
| 314 | self.assertEqual(initial_count, 3) |
| 315 | |
| 316 | # Test dropping individual files without glob |
| 317 | commands.cmd_drop("file1.txt") |
| 318 | self.assertNotIn(str(Path("file1.txt").resolve()), coder.abs_fnames) |
| 319 | self.assertIn(str(Path("file2.txt").resolve()), coder.abs_fnames) |
| 320 | self.assertEqual(len(coder.abs_fnames), initial_count - 1) |
| 321 | |
| 322 | # Test dropping multiple files without glob |
| 323 | commands.cmd_drop("file2.txt file3.py") |
| 324 | self.assertNotIn(str(Path("file2.txt").resolve()), coder.abs_fnames) |
| 325 | self.assertNotIn(str(Path("file3.py").resolve()), coder.abs_fnames) |
| 326 | self.assertEqual(len(coder.abs_fnames), 0) |
| 327 | |
| 328 | def test_cmd_add_bad_encoding(self): |
| 329 | # Initialize the Commands and InputOutput objects |
nothing calls this directly
no test coverage detected