Skip to content
Prev Previous commit
Next Next commit
Add test for get_or_set with None to count as cache miss
  • Loading branch information
Harsh3006 committed Aug 10, 2026
commit 15f47bf8be96abc71b38f0143615ea5630f44ff9
7 changes: 7 additions & 0 deletions tests/panels/test_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,13 @@ def test_get_or_set_does_not_override_existing_value(self):
},
)

def test_get_or_set_none_counts_as_miss(self):
cache.cache.clear()

self.assertIsNone(cache.cache.get_or_set("foo", None))
self.assertEqual(self.panel.hits, 0)
self.assertEqual(self.panel.misses, 1)

def test_insert_content(self):
"""
Test that the panel only inserts content after generate_stats and
Expand Down