Test cache clearing functionality.
(self)
| 366 | self.assertGreater(stats["cache_file_size_bytes"], 0) |
| 367 | |
| 368 | def test_clear_cache(self) -> None: |
| 369 | """Test cache clearing functionality.""" |
| 370 | cache_file = self.cache_dir / "clear.json" |
| 371 | cache = FingerprintCache(cache_file) |
| 372 | |
| 373 | # Add an entry |
| 374 | test_file = self.temp_dir / "clear.txt" |
| 375 | self.create_test_file(test_file, "clear content") |
| 376 | cache.has_changed(test_file, time.time() - 1) |
| 377 | |
| 378 | # Verify cache has entry |
| 379 | self.assertEqual(len(cache.cache), 1) |
| 380 | self.assertTrue(cache_file.exists()) |
| 381 | |
| 382 | # Clear cache |
| 383 | cache.clear_cache() |
| 384 | |
| 385 | # Verify cache is cleared |
| 386 | self.assertEqual(len(cache.cache), 0) |
| 387 | self.assertFalse(cache_file.exists()) |
| 388 | |
| 389 | def test_deleted_file_detection(self) -> None: |
| 390 | """Test detection of files that were cached but have been deleted.""" |
nothing calls this directly
no test coverage detected