v.0.11.4
This commit is contained in:
@@ -30,6 +30,16 @@ class AnalyticsCacheTests(unittest.TestCase):
|
||||
self.assertFalse(cache._snapshot_thread.is_alive())
|
||||
store.close()
|
||||
|
||||
def test_background_worker_has_no_dashboard_windows_until_requested(self):
|
||||
with tempfile.TemporaryDirectory() as td:
|
||||
store = AlertStore(os.path.join(td, "ids.db"))
|
||||
history = TrafficHistory("", retention_hours=24, max_events=1000, memory_events=1000)
|
||||
cache = AnalyticsSnapshotCache(store, history, threading.Event(), interval_seconds=60)
|
||||
self.assertEqual(cache._due_windows(), [])
|
||||
cache.get(900)
|
||||
self.assertEqual(cache._due_windows(), [900])
|
||||
store.close()
|
||||
|
||||
def test_refresh_persists_all_dashboard_windows_in_sqlite_cache(self):
|
||||
with tempfile.TemporaryDirectory() as td:
|
||||
store = AlertStore(os.path.join(td, "ids.db"))
|
||||
|
||||
Reference in New Issue
Block a user