MCPcopy Create free account
hub / github.com/FastLED/FastLED / test_clear_cache

Method test_clear_cache

ci/tests/test_fingerprint_cache.py:368–387  ·  view source on GitHub ↗

Test cache clearing functionality.

(self)

Source from the content-addressed store, hash-verified

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."""

Callers

nothing calls this directly

Calls 5

create_test_fileMethod · 0.95
has_changedMethod · 0.95
clear_cacheMethod · 0.95
FingerprintCacheClass · 0.90
timeMethod · 0.80

Tested by

no test coverage detected